mirror of
https://github.com/owntone/owntone-server.git
synced 2025-10-30 00:05:05 -04:00
[dacp] Add support for non-library artwork, e.g. from Spotify searches
Fixes #1936
This commit is contained in:
parent
921d4446d6
commit
6f45f8b4a5
@ -164,7 +164,7 @@ dacp_nowplaying(struct evbuffer *evbuf, struct player_status *status, struct db_
|
|||||||
* FIXME: Giving the client invalid ids on purpose is hardly ideal, but the
|
* FIXME: Giving the client invalid ids on purpose is hardly ideal, but the
|
||||||
* clients don't seem to use these ids for anything other than rating.
|
* clients don't seem to use these ids for anything other than rating.
|
||||||
*/
|
*/
|
||||||
if (queue_item->data_kind == DATA_KIND_HTTP || queue_item->data_kind == DATA_KIND_PIPE)
|
if (queue_item->data_kind == DATA_KIND_HTTP || queue_item->data_kind == DATA_KIND_PIPE || queue_item->file_id == DB_MEDIA_FILE_NON_PERSISTENT_ID)
|
||||||
{
|
{
|
||||||
// Could also use queue_item->queue_version, but it changes a bit too much
|
// Could also use queue_item->queue_version, but it changes a bit too much
|
||||||
// leading to Remote reloading too much
|
// leading to Remote reloading too much
|
||||||
@ -2257,11 +2257,11 @@ dacp_reply_playstatusupdate(struct httpd_request *hreq)
|
|||||||
static int
|
static int
|
||||||
dacp_reply_nowplayingartwork(struct httpd_request *hreq)
|
dacp_reply_nowplayingartwork(struct httpd_request *hreq)
|
||||||
{
|
{
|
||||||
|
struct player_status status;
|
||||||
char clen[32];
|
char clen[32];
|
||||||
const char *param;
|
const char *param;
|
||||||
char *ctype;
|
char *ctype;
|
||||||
size_t len;
|
size_t len;
|
||||||
uint32_t id;
|
|
||||||
int max_w;
|
int max_w;
|
||||||
int max_h;
|
int max_h;
|
||||||
int ret;
|
int ret;
|
||||||
@ -2298,11 +2298,11 @@ dacp_reply_nowplayingartwork(struct httpd_request *hreq)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = player_playing_now(&id);
|
player_get_status(&status);
|
||||||
if (ret < 0)
|
if (status.status == PLAY_STOPPED)
|
||||||
goto no_artwork;
|
goto no_artwork;
|
||||||
|
|
||||||
ret = artwork_get_item(hreq->out_body, id, max_w, max_h, 0);
|
ret = artwork_get_by_queue_item_id(hreq->out_body, status.item_id, max_w, max_h, 0);
|
||||||
len = evbuffer_get_length(hreq->out_body);
|
len = evbuffer_get_length(hreq->out_body);
|
||||||
|
|
||||||
switch (ret)
|
switch (ret)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user