mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-03 15:20:09 -05:00
[api] Stop playback once last item is removed from the queue
This commit is contained in:
parent
2e93c66dd0
commit
04789e995c
@ -2623,6 +2623,7 @@ static int
|
|||||||
jsonapi_reply_queue_tracks_delete(struct httpd_request *hreq)
|
jsonapi_reply_queue_tracks_delete(struct httpd_request *hreq)
|
||||||
{
|
{
|
||||||
uint32_t item_id;
|
uint32_t item_id;
|
||||||
|
uint32_t count;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = safe_atou32(hreq->path_parts[3], &item_id);
|
ret = safe_atou32(hreq->path_parts[3], &item_id);
|
||||||
@ -2639,6 +2640,13 @@ jsonapi_reply_queue_tracks_delete(struct httpd_request *hreq)
|
|||||||
return HTTP_INTERNAL;
|
return HTTP_INTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
db_queue_get_count(&count);
|
||||||
|
if (count == 0)
|
||||||
|
{
|
||||||
|
player_playback_stop();
|
||||||
|
db_queue_clear(0);
|
||||||
|
}
|
||||||
|
|
||||||
return HTTP_NOCONTENT;
|
return HTTP_NOCONTENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user