mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-23 11:32:34 -05:00
Play only a single item when playspec has item-spec (Podcasts/Audiobooks)
This commit is contained in:
parent
c01698e462
commit
708b76ce1e
@ -899,10 +899,9 @@ dacp_reply_playspec(struct evhttp_request *req, struct evbuffer *evbuf, char **u
|
||||
if (!shuffle)
|
||||
{
|
||||
/* Start song ID */
|
||||
param = evhttp_find_header(query, "container-item-spec");
|
||||
if (!param)
|
||||
param = evhttp_find_header(query, "item-spec");
|
||||
if (!param)
|
||||
if ((param = evhttp_find_header(query, "item-spec")))
|
||||
plid = 0; // This is a podcast/audiobook - just play a single item, not a playlist
|
||||
else if (!(param = evhttp_find_header(query, "container-item-spec")))
|
||||
{
|
||||
DPRINTF(E_LOG, L_DACP, "No container-item-spec/item-spec in playspec request\n");
|
||||
|
||||
|
29
src/player.c
29
src/player.c
@ -849,17 +849,36 @@ player_queue_make_pl(int plid, uint32_t *id)
|
||||
struct player_source *ps;
|
||||
struct player_source *p;
|
||||
uint32_t i;
|
||||
char buf[124];
|
||||
|
||||
memset(&qp, 0, sizeof(struct query_params));
|
||||
|
||||
qp.id = plid;
|
||||
qp.type = Q_PLITEMS;
|
||||
qp.offset = 0;
|
||||
qp.limit = 0;
|
||||
qp.sort = S_NONE;
|
||||
if (plid)
|
||||
{
|
||||
qp.id = plid;
|
||||
qp.type = Q_PLITEMS;
|
||||
qp.offset = 0;
|
||||
qp.limit = 0;
|
||||
qp.sort = S_NONE;
|
||||
}
|
||||
else if (*id)
|
||||
{
|
||||
qp.id = 0;
|
||||
qp.type = Q_ITEMS;
|
||||
qp.offset = 0;
|
||||
qp.limit = 0;
|
||||
qp.sort = S_NONE;
|
||||
snprintf(buf, sizeof(buf), "f.id = %" PRIu32, *id);
|
||||
qp.filter = strdup(buf);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
ps = player_queue_make(&qp, NULL);
|
||||
|
||||
if (qp.filter)
|
||||
free(qp.filter);
|
||||
|
||||
/* Shortcut for shuffled playlist */
|
||||
if (*id == 0)
|
||||
return ps;
|
||||
|
Loading…
x
Reference in New Issue
Block a user