Lidarr/src/Lidarr.Api.V1/Blacklist/BlacklistResource.cs

48 lines
1.4 KiB
C#
Raw Normal View History

2017-09-04 02:20:56 +00:00
using System;
using System.Collections.Generic;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Qualities;
2017-10-31 01:28:29 +00:00
using Lidarr.Api.V1.Artist;
2017-09-04 02:20:56 +00:00
using Lidarr.Http.REST;
2017-10-31 01:28:29 +00:00
namespace Lidarr.Api.V1.Blacklist
2017-09-04 02:20:56 +00:00
{
public class BlacklistResource : RestResource
{
public int ArtistId { get; set; }
public List<int> AlbumIds { get; set; }
public string SourceTitle { get; set; }
public QualityModel Quality { get; set; }
public DateTime Date { get; set; }
public DownloadProtocol Protocol { get; set; }
public string Indexer { get; set; }
public string Message { get; set; }
public ArtistResource Artist { get; set; }
}
public static class BlacklistResourceMapper
{
public static BlacklistResource MapToResource(this NzbDrone.Core.Blacklisting.Blacklist model)
{
if (model == null) return null;
return new BlacklistResource
{
Id = model.Id,
ArtistId = model.ArtistId,
AlbumIds = model.AlbumIds,
SourceTitle = model.SourceTitle,
Quality = model.Quality,
Date = model.Date,
Protocol = model.Protocol,
Indexer = model.Indexer,
Message = model.Message,
Artist = model.Artist.ToResource()
};
}
}
}