mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fixed: Queue Details endpoint using wrong parameters
This commit is contained in:
parent
acfe2ceef4
commit
8befd77f0f
2 changed files with 7 additions and 7 deletions
|
@ -27,8 +27,8 @@ namespace Lidarr.Api.V1.Queue
|
||||||
|
|
||||||
private List<QueueResource> GetQueue()
|
private List<QueueResource> GetQueue()
|
||||||
{
|
{
|
||||||
var includeSeries = Request.GetBooleanQueryParameter("includeSeries");
|
var includeArtist = Request.GetBooleanQueryParameter("includeArtist");
|
||||||
var includeEpisode = Request.GetBooleanQueryParameter("includeEpisode", true);
|
var includeAlbum = Request.GetBooleanQueryParameter("includeAlbum", true);
|
||||||
var queue = _queueService.GetQueue();
|
var queue = _queueService.GetQueue();
|
||||||
var pending = _pendingReleaseService.GetPendingQueue();
|
var pending = _pendingReleaseService.GetPendingQueue();
|
||||||
var fullQueue = queue.Concat(pending);
|
var fullQueue = queue.Concat(pending);
|
||||||
|
@ -38,7 +38,7 @@ namespace Lidarr.Api.V1.Queue
|
||||||
|
|
||||||
if (artistIdQuery.HasValue)
|
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)
|
if (albumIdsQuery.HasValue)
|
||||||
|
@ -49,10 +49,10 @@ namespace Lidarr.Api.V1.Queue
|
||||||
.Select(e => Convert.ToInt32(e))
|
.Select(e => Convert.ToInt32(e))
|
||||||
.ToList();
|
.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)
|
public void Handle(QueueUpdatedEvent message)
|
||||||
|
|
|
@ -67,9 +67,9 @@ namespace Lidarr.Api.V1.Queue
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<QueueResource> ToResource(this IEnumerable<NzbDrone.Core.Queue.Queue> models, bool includeSeries, bool includeEpisode)
|
public static List<QueueResource> ToResource(this IEnumerable<NzbDrone.Core.Queue.Queue> models, bool includeArtist, bool includeAlbum)
|
||||||
{
|
{
|
||||||
return models.Select((m) => ToResource(m, includeSeries, includeEpisode)).ToList();
|
return models.Select((m) => ToResource(m, includeArtist, includeAlbum)).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue