|
|
@ -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)
|
|
|
|