mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-29 00:23:23 -05:00
[mpd] command 'currentsong': report current item if player is stopped
This commit is contained in:
parent
80e0808b18
commit
6f4f7c5b16
11
src/mpd.c
11
src/mpd.c
@ -608,16 +608,13 @@ mpd_command_currentsong(struct evbuffer *evbuf, int argc, char **argv, char **er
|
|||||||
player_get_status(&status);
|
player_get_status(&status);
|
||||||
|
|
||||||
if (status.status == PLAY_STOPPED)
|
if (status.status == PLAY_STOPPED)
|
||||||
{
|
queue_item = db_queue_fetch_bypos(0, status.shuffle);
|
||||||
// Return empty evbuffer if there is no current playing song
|
else
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
queue_item = db_queue_fetch_byitemid(status.item_id);
|
queue_item = db_queue_fetch_byitemid(status.item_id);
|
||||||
|
|
||||||
if (!queue_item)
|
if (!queue_item)
|
||||||
{
|
{
|
||||||
*errmsg = safe_asprintf("Error adding queue item info for file with id: %d", status.item_id);
|
return 0;
|
||||||
return ACK_ERROR_UNKNOWN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = mpd_add_db_queue_item(evbuf, queue_item);
|
ret = mpd_add_db_queue_item(evbuf, queue_item);
|
||||||
|
Loading…
Reference in New Issue
Block a user