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

57 lines
1.5 KiB
C#
Raw Normal View History

2013-05-03 06:53:32 +00:00
using System;
2013-06-11 01:55:05 +00:00
using System.Collections.Generic;
using NzbDrone.Api.Episodes;
2013-05-03 06:53:32 +00:00
using NzbDrone.Api.REST;
using NzbDrone.Api.Series;
2013-06-11 01:55:05 +00:00
using NzbDrone.Core.History;
using NzbDrone.Core.Qualities;
2013-05-03 06:53:32 +00:00
namespace NzbDrone.Api.History
{
public class HistoryResource : RestResource
{
public int EpisodeId { get; set; }
public int SeriesId { 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 EpisodeResource Episode { get; set; }
public SeriesResource Series { get; set; }
2013-05-03 06:53:32 +00:00
}
public static class HistoryResourceMapper
{
public static HistoryResource ToResource(this Core.History.History model)
{
if (model == null) return null;
return new HistoryResource
{
Id = model.Id,
EpisodeId = model.EpisodeId,
SeriesId = model.SeriesId,
SourceTitle = model.SourceTitle,
Quality = model.Quality,
//QualityCutoffNotMet
Date = model.Date,
DownloadId = model.DownloadId,
EventType = model.EventType,
Data = model.Data
//Episode
//Series
};
}
}
2013-05-03 06:53:32 +00:00
}