You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.3 KiB
52 lines
1.3 KiB
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using NzbDrone.Core.ImportLists.Exclusions;
|
|
using Sonarr.Http.REST;
|
|
|
|
namespace Sonarr.Api.V3.ImportLists
|
|
{
|
|
public class ImportListExclusionResource : RestResource
|
|
{
|
|
public int TvdbId { get; set; }
|
|
public string Title { get; set; }
|
|
}
|
|
|
|
public static class ImportListExclusionResourceMapper
|
|
{
|
|
public static ImportListExclusionResource ToResource(this ImportListExclusion model)
|
|
{
|
|
if (model == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return new ImportListExclusionResource
|
|
{
|
|
Id = model.Id,
|
|
TvdbId = model.TvdbId,
|
|
Title = model.Title,
|
|
};
|
|
}
|
|
|
|
public static ImportListExclusion ToModel(this ImportListExclusionResource resource)
|
|
{
|
|
if (resource == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return new ImportListExclusion
|
|
{
|
|
Id = resource.Id,
|
|
TvdbId = resource.TvdbId,
|
|
Title = resource.Title
|
|
};
|
|
}
|
|
|
|
public static List<ImportListExclusionResource> ToResource(this IEnumerable<ImportListExclusion> filters)
|
|
{
|
|
return filters.Select(ToResource).ToList();
|
|
}
|
|
}
|
|
}
|