Radarr/src/NzbDrone.Api/History/HistoryResource.cs

52 lines
1.4 KiB
C#
Raw Normal View History

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;
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
{
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; }
public bool QualityCutoffNotMet { get; set; }
2013-05-03 06:53:32 +00:00
public DateTime Date { get; set; }
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; }
public MovieResource Movie { get; set; }
2013-05-03 06:53:32 +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;
}
return new HistoryResource
{
Id = model.Id,
MovieId = model.MovieId,
SourceTitle = model.SourceTitle,
Quality = model.Quality,
2019-12-22 22:08:53 +00:00
//QualityCutoffNotMet
Date = model.Date,
DownloadId = model.DownloadId,
EventType = model.EventType,
2019-12-22 22:08:53 +00:00
Data = model.Data
};
}
}
2013-05-03 06:53:32 +00:00
}