mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 23:55:57 -05:00
[dacp] Return the playqueue even if player is stopped
This commit is contained in:
parent
07947a526d
commit
d000ea571b
@ -1564,28 +1564,24 @@ dacp_reply_playqueuecontents(struct evhttp_request *req, struct evbuffer *evbuf,
|
|||||||
{
|
{
|
||||||
player_get_status(&status);
|
player_get_status(&status);
|
||||||
|
|
||||||
/* Get queue and make songlist only if playing or paused */
|
queue = player_queue_get_bypos(abs(span));
|
||||||
if (status.status != PLAY_STOPPED)
|
if (queue)
|
||||||
{
|
{
|
||||||
queue = player_queue_get_bypos(abs(span));
|
i = 0;
|
||||||
if (queue)
|
count = queue_count(queue);
|
||||||
|
for (n = 0; (n < count) && (n < abs(span)); n++)
|
||||||
{
|
{
|
||||||
i = 0;
|
item = queue_get_byindex(queue, n, 0);
|
||||||
count = queue_count(queue);
|
ret = playqueuecontents_add_source(songlist, queueitem_id(item), (n + i + 1), status.plid);
|
||||||
for (n = 0; (n < count) && (n < abs(span)); n++)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
item = queue_get_byindex(queue, n, 0);
|
DPRINTF(E_LOG, L_DACP, "Could not add song to songlist for playqueue-contents\n");
|
||||||
ret = playqueuecontents_add_source(songlist, queueitem_id(item), (n + i + 1), status.plid);
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
DPRINTF(E_LOG, L_DACP, "Could not add song to songlist for playqueue-contents\n");
|
|
||||||
|
|
||||||
dmap_send_error(req, "ceQR", "Out of memory");
|
dmap_send_error(req, "ceQR", "Out of memory");
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
queue_free(queue);
|
|
||||||
}
|
}
|
||||||
|
queue_free(queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user