2018-02-19 07:18:14 +00:00
|
|
|
using System;
|
2013-06-11 01:55:05 +00:00
|
|
|
using System.Collections.Generic;
|
2018-02-19 07:18:14 +00:00
|
|
|
using NzbDrone.Api.Movies;
|
2013-06-11 01:55:05 +00:00
|
|
|
using NzbDrone.Core.History;
|
2014-01-18 11:44:36 +00:00
|
|
|
using NzbDrone.Core.Qualities;
|
2019-12-22 22:08:53 +00:00
|
|
|
using Radarr.Http.REST;
|
2013-05-03 06:53:32 +00:00
|
|
|
|
|
|
|
namespace NzbDrone.Api.History
|
|
|
|
{
|
|
|
|
public class HistoryResource : RestResource
|
|
|
|
{
|
2017-01-02 19:15:13 +00:00
|
|
|
public int MovieId { get; set; }
|
2013-06-09 06:45:34 +00:00
|
|
|
public string SourceTitle { get; set; }
|
2013-05-03 06:53:32 +00:00
|
|
|
public QualityModel Quality { get; set; }
|
2015-10-03 17:45:26 +00:00
|
|
|
public bool QualityCutoffNotMet { get; set; }
|
2013-05-03 06:53:32 +00:00
|
|
|
public DateTime Date { get; set; }
|
2014-12-19 00:26:42 +00:00
|
|
|
public string DownloadId { get; set; }
|
2013-05-03 06:53:32 +00:00
|
|
|
|
2013-06-11 01:55:05 +00:00
|
|
|
public HistoryEventType EventType { get; set; }
|
|
|
|
|
|
|
|
public Dictionary<string, string> Data { get; set; }
|
2017-01-02 19:15:13 +00:00
|
|
|
public MovieResource Movie { get; set; }
|
2013-05-03 06:53:32 +00:00
|
|
|
}
|
2016-03-25 00:56:29 +00:00
|
|
|
|
|
|
|
public static class HistoryResourceMapper
|
|
|
|
{
|
|
|
|
public static HistoryResource ToResource(this Core.History.History model)
|
|
|
|
{
|
2019-12-22 22:08:53 +00:00
|
|
|
if (model == null)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2016-03-25 00:56:29 +00:00
|
|
|
|
|
|
|
return new HistoryResource
|
|
|
|
{
|
|
|
|
Id = model.Id,
|
2017-01-02 19:15:13 +00:00
|
|
|
MovieId = model.MovieId,
|
2016-03-25 00:56:29 +00:00
|
|
|
SourceTitle = model.SourceTitle,
|
|
|
|
Quality = model.Quality,
|
2019-12-22 22:08:53 +00:00
|
|
|
|
2016-03-25 00:56:29 +00:00
|
|
|
//QualityCutoffNotMet
|
|
|
|
Date = model.Date,
|
|
|
|
DownloadId = model.DownloadId,
|
|
|
|
|
|
|
|
EventType = model.EventType,
|
|
|
|
|
2019-12-22 22:08:53 +00:00
|
|
|
Data = model.Data
|
2016-03-25 00:56:29 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2013-05-03 06:53:32 +00:00
|
|
|
}
|