public static QueueResource ToResource(this NzbDrone.Core.Queue.Queue model, bool includeMovie) { if (model == null) { return(null); } return(new QueueResource { Id = model.Id, MovieId = model.Movie?.Id, Movie = includeMovie && model.Movie != null?model.Movie.ToResource(0) : null, Languages = model.Languages, Quality = model.Quality, CustomFormats = model.RemoteMovie?.CustomFormats.ToResource(), Size = model.Size, Title = model.Title, Sizeleft = model.Sizeleft, Timeleft = model.Timeleft, EstimatedCompletionTime = model.EstimatedCompletionTime, Status = model.Status.FirstCharToLower(), TrackedDownloadStatus = model.TrackedDownloadStatus, TrackedDownloadState = model.TrackedDownloadState, StatusMessages = model.StatusMessages, ErrorMessage = model.ErrorMessage, DownloadId = model.DownloadId, Protocol = model.Protocol, DownloadClient = model.DownloadClient, Indexer = model.Indexer, OutputPath = model.OutputPath }); }
public static QueueResource ToResource(this NzbDrone.Core.Queue.Queue model, bool includeArtist, bool includeAlbum) { if (model == null) { return(null); } return(new QueueResource { Id = model.Id, ArtistId = model.Artist?.Id, AlbumId = model.Album?.Id, Artist = includeArtist && model.Artist != null?model.Artist.ToResource() : null, Album = includeAlbum && model.Album != null?model.Album.ToResource() : null, Quality = model.Quality, Size = model.Size, Title = model.Title, Sizeleft = model.Sizeleft, Timeleft = model.Timeleft, EstimatedCompletionTime = model.EstimatedCompletionTime, Status = model.Status.FirstCharToLower(), TrackedDownloadStatus = model.TrackedDownloadStatus, TrackedDownloadState = model.TrackedDownloadState, StatusMessages = model.StatusMessages, ErrorMessage = model.ErrorMessage, DownloadId = model.DownloadId, Protocol = model.Protocol, DownloadClient = model.DownloadClient, Indexer = model.Indexer, OutputPath = model.OutputPath, DownloadForced = model.DownloadForced }); }
public static QueueResource ToResource(this NzbDrone.Core.Queue.Queue model, bool includeSeries, bool includeEpisode) { if (model == null) { return(null); } return(new QueueResource { Id = model.Id, SeriesId = model.Series?.Id, EpisodeId = model.Episode?.Id, Series = includeSeries && model.Series != null?model.Series.ToResource() : null, Episode = includeEpisode && model.Episode != null?model.Episode.ToResource() : null, Language = model.Language, Quality = model.Quality, Size = model.Size, Title = model.Title, Sizeleft = model.Sizeleft, Timeleft = model.Timeleft, EstimatedCompletionTime = model.EstimatedCompletionTime, Status = model.Status.FirstCharToLower(), TrackedDownloadStatus = model.TrackedDownloadStatus, TrackedDownloadState = model.TrackedDownloadState, StatusMessages = model.StatusMessages, ErrorMessage = model.ErrorMessage, DownloadId = model.DownloadId, Protocol = model.Protocol, DownloadClient = model.DownloadClient, Indexer = model.Indexer, OutputPath = model.OutputPath }); }
public static QueueResource ToResource(this NzbDrone.Core.Queue.Queue model, bool includeAuthor, bool includeBook) { if (model == null) { return(null); } return(new QueueResource { Id = model.Id, AuthorId = model.Author?.Id, BookId = model.Book?.Id, Author = includeAuthor && model.Author != null?model.Author.ToResource() : null, Book = includeBook && model.Book != null?model.Book.ToResource() : null, Quality = model.Quality, Size = model.Size, Title = model.Title, Sizeleft = model.Sizeleft, Timeleft = model.Timeleft, EstimatedCompletionTime = model.EstimatedCompletionTime, Status = model.Status.FirstCharToLower(), TrackedDownloadStatus = model.TrackedDownloadStatus, TrackedDownloadState = model.TrackedDownloadState, StatusMessages = model.StatusMessages, ErrorMessage = model.ErrorMessage, DownloadId = model.DownloadId, Protocol = model.Protocol, DownloadClient = model.DownloadClient, Indexer = model.Indexer, OutputPath = model.OutputPath, DownloadForced = model.DownloadForced }); }