From 8befd77f0fafe7249ae0bf8b203960a5c3fb3233 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 9 Mar 2019 21:00:06 -0500 Subject: [PATCH] Fixed: Queue Details endpoint using wrong parameters --- src/Lidarr.Api.V1/Queue/QueueDetailsModule.cs | 10 +++++----- src/Lidarr.Api.V1/Queue/QueueResource.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Lidarr.Api.V1/Queue/QueueDetailsModule.cs b/src/Lidarr.Api.V1/Queue/QueueDetailsModule.cs index 201d9f776..72c90f1f5 100644 --- a/src/Lidarr.Api.V1/Queue/QueueDetailsModule.cs +++ b/src/Lidarr.Api.V1/Queue/QueueDetailsModule.cs @@ -27,8 +27,8 @@ namespace Lidarr.Api.V1.Queue private List GetQueue() { - var includeSeries = Request.GetBooleanQueryParameter("includeSeries"); - var includeEpisode = Request.GetBooleanQueryParameter("includeEpisode", true); + var includeArtist = Request.GetBooleanQueryParameter("includeArtist"); + var includeAlbum = Request.GetBooleanQueryParameter("includeAlbum", true); var queue = _queueService.GetQueue(); var pending = _pendingReleaseService.GetPendingQueue(); var fullQueue = queue.Concat(pending); @@ -38,7 +38,7 @@ namespace Lidarr.Api.V1.Queue if (artistIdQuery.HasValue) { - return fullQueue.Where(q => q.Artist?.Id == (int)artistIdQuery).ToResource(includeSeries, includeEpisode); + return fullQueue.Where(q => q.Artist?.Id == (int)artistIdQuery).ToResource(includeArtist, includeAlbum); } if (albumIdsQuery.HasValue) @@ -49,10 +49,10 @@ namespace Lidarr.Api.V1.Queue .Select(e => Convert.ToInt32(e)) .ToList(); - return fullQueue.Where(q => q.Album != null && albumIds.Contains(q.Album.Id)).ToResource(includeSeries, includeEpisode); + return fullQueue.Where(q => q.Album != null && albumIds.Contains(q.Album.Id)).ToResource(includeArtist, includeAlbum); } - return fullQueue.ToResource(includeSeries, includeEpisode); + return fullQueue.ToResource(includeArtist, includeAlbum); } public void Handle(QueueUpdatedEvent message) diff --git a/src/Lidarr.Api.V1/Queue/QueueResource.cs b/src/Lidarr.Api.V1/Queue/QueueResource.cs index 630ce4fbc..d9cfa382b 100644 --- a/src/Lidarr.Api.V1/Queue/QueueResource.cs +++ b/src/Lidarr.Api.V1/Queue/QueueResource.cs @@ -67,9 +67,9 @@ namespace Lidarr.Api.V1.Queue }; } - public static List ToResource(this IEnumerable models, bool includeSeries, bool includeEpisode) + public static List ToResource(this IEnumerable models, bool includeArtist, bool includeAlbum) { - return models.Select((m) => ToResource(m, includeSeries, includeEpisode)).ToList(); + return models.Select((m) => ToResource(m, includeArtist, includeAlbum)).ToList(); } } }