mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-23 11:32:34 -05:00
Merge pull request #1862 from hacketiwack/master
[api] Stop playback once last item is removed from the queue
This commit is contained in:
commit
7cde752f20
@ -2623,6 +2623,7 @@ static int
|
||||
jsonapi_reply_queue_tracks_delete(struct httpd_request *hreq)
|
||||
{
|
||||
uint32_t item_id;
|
||||
uint32_t count;
|
||||
int ret;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
db_queue_get_count(&count);
|
||||
if (count == 0)
|
||||
{
|
||||
player_playback_stop();
|
||||
db_queue_clear(0);
|
||||
}
|
||||
|
||||
return HTTP_NOCONTENT;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user