mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 05:34:58 -05:00
[jsonapi] Get currently playing queue item details (closes #1206)
Add now_playing shorthand, so that /api/queue?id=now_playing returns the currently playing queue item info.
This commit is contained in:
@@ -2682,7 +2682,11 @@ jsonapi_reply_queue(struct httpd_request *hreq)
|
||||
query_params.sort = S_SHUFFLE_POS;
|
||||
|
||||
param = evhttp_find_header(hreq->query, "id");
|
||||
if (param && safe_atou32(param, &item_id) == 0)
|
||||
if (param && strcmp(param, "now_playing") == 0)
|
||||
{
|
||||
query_params.filter = db_mprintf("id = %d", status.item_id);
|
||||
}
|
||||
else if (param && safe_atou32(param, &item_id) == 0)
|
||||
{
|
||||
query_params.filter = db_mprintf("id = %d", item_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user