diff --git a/src/db.c b/src/db.c index 7d8e8eae..ae2c2ca5 100644 --- a/src/db.c +++ b/src/db.c @@ -4691,7 +4691,10 @@ queue_fetch_byposrelativetoitem(int pos, uint32_t item_id, char shuffle, struct ret = queue_fetch_bypos(pos_absolute, shuffle, queue_item, with_metadata); - DPRINTF(E_DBG, L_DB, "Fetch by pos: fetched item (id=%d, pos=%d, file-id=%d)\n", queue_item->id, queue_item->pos, queue_item->file_id); + if (ret < 0) + DPRINTF(E_LOG, L_DB, "Error fetching item by pos: pos (%d) relative to item with id (%d)\n", pos, item_id); + else + DPRINTF(E_DBG, L_DB, "Fetch by pos: fetched item (id=%d, pos=%d, file-id=%d)\n", queue_item->id, queue_item->pos, queue_item->file_id); return ret; } diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index f290e5f3..b3bad157 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -1017,6 +1017,8 @@ dacp_reply_cue_play(struct evhttp_request *req, struct evbuffer *evbuf, char **u } } + player_get_status(&status); + cuequery = evhttp_find_header(query, "query"); if (cuequery) { @@ -1031,12 +1033,9 @@ dacp_reply_cue_play(struct evhttp_request *req, struct evbuffer *evbuf, char **u return; } } - else + else if (status.status != PLAY_STOPPED) { - player_get_status(&status); - - if (status.status != PLAY_STOPPED) - player_playback_stop(); + player_playback_stop(); } param = evhttp_find_header(query, "dacp.shufflestate"); @@ -1597,6 +1596,8 @@ dacp_reply_playqueuecontents(struct evhttp_request *req, struct evbuffer *evbuf, return; } + player_get_status(&status); + /* * If the span parameter is negativ make song list for Previously Played, * otherwise make song list for Up Next and begin with first song after playlist position. @@ -1626,8 +1627,6 @@ dacp_reply_playqueuecontents(struct evhttp_request *req, struct evbuffer *evbuf, } else { - player_get_status(&status); - memset(&query_params, 0, sizeof(struct query_params)); if (status.shuffle) query_params.sort = S_SHUFFLE_POS;