mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
d8c89f5bbd
Ability to cancel an import lookup/search at any point. Ability to move artist path from Artist Edit or bulk move from Mass Editor. Trigger manual import for Artist path from Artist Detail page. Pulled from Sonarr
64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using NzbDrone.Core.History;
|
|
using NzbDrone.Core.Languages;
|
|
using NzbDrone.Core.Qualities;
|
|
using Lidarr.Api.V1.Albums;
|
|
using Lidarr.Api.V1.Artist;
|
|
using Lidarr.Api.V1.Tracks;
|
|
using Lidarr.Http.REST;
|
|
|
|
namespace Lidarr.Api.V1.History
|
|
{
|
|
public class HistoryResource : RestResource
|
|
{
|
|
public int AlbumId { get; set; }
|
|
public int ArtistId { get; set; }
|
|
public int TrackId { get; set; }
|
|
public string SourceTitle { get; set; }
|
|
public Language Language { get; set; }
|
|
public QualityModel Quality { get; set; }
|
|
public bool QualityCutoffNotMet { get; set; }
|
|
public bool LanguageCutoffNotMet { get; set; }
|
|
public DateTime Date { get; set; }
|
|
public string DownloadId { get; set; }
|
|
|
|
public HistoryEventType EventType { get; set; }
|
|
|
|
public Dictionary<string, string> Data { get; set; }
|
|
|
|
public AlbumResource Album { get; set; }
|
|
public ArtistResource Artist { get; set; }
|
|
public TrackResource Track { get; set; }
|
|
}
|
|
|
|
public static class HistoryResourceMapper
|
|
{
|
|
public static HistoryResource ToResource(this NzbDrone.Core.History.History model)
|
|
{
|
|
if (model == null) return null;
|
|
|
|
return new HistoryResource
|
|
{
|
|
Id = model.Id,
|
|
|
|
AlbumId = model.AlbumId,
|
|
ArtistId = model.ArtistId,
|
|
TrackId = model.TrackId,
|
|
SourceTitle = model.SourceTitle,
|
|
Language = model.Language,
|
|
Quality = model.Quality,
|
|
//QualityCutoffNotMet
|
|
Date = model.Date,
|
|
DownloadId = model.DownloadId,
|
|
|
|
EventType = model.EventType,
|
|
|
|
Data = model.Data
|
|
//Episode
|
|
//Series
|
|
};
|
|
}
|
|
}
|
|
}
|