mirror of
https://github.com/owntone/owntone-server.git
synced 2025-07-28 09:50:13 -04: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)
|
if (!shuffle)
|
||||||
{
|
{
|
||||||
/* Start song ID */
|
/* Start song ID */
|
||||||
param = evhttp_find_header(query, "container-item-spec");
|
if ((param = evhttp_find_header(query, "item-spec")))
|
||||||
if (!param)
|
plid = 0; // This is a podcast/audiobook - just play a single item, not a playlist
|
||||||
param = evhttp_find_header(query, "item-spec");
|
else if (!(param = evhttp_find_header(query, "container-item-spec")))
|
||||||
if (!param)
|
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_DACP, "No container-item-spec/item-spec in playspec request\n");
|
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 *ps;
|
||||||
struct player_source *p;
|
struct player_source *p;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
char buf[124];
|
||||||
|
|
||||||
memset(&qp, 0, sizeof(struct query_params));
|
memset(&qp, 0, sizeof(struct query_params));
|
||||||
|
|
||||||
qp.id = plid;
|
if (plid)
|
||||||
qp.type = Q_PLITEMS;
|
{
|
||||||
qp.offset = 0;
|
qp.id = plid;
|
||||||
qp.limit = 0;
|
qp.type = Q_PLITEMS;
|
||||||
qp.sort = S_NONE;
|
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);
|
ps = player_queue_make(&qp, NULL);
|
||||||
|
|
||||||
|
if (qp.filter)
|
||||||
|
free(qp.filter);
|
||||||
|
|
||||||
/* Shortcut for shuffled playlist */
|
/* Shortcut for shuffled playlist */
|
||||||
if (*id == 0)
|
if (*id == 0)
|
||||||
return ps;
|
return ps;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user