mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 23:55:57 -05:00
Support clear-first in cue play command
This commit is contained in:
parent
0df4ab4555
commit
5674314161
@ -727,10 +727,25 @@ dacp_reply_cue_play(struct evhttp_request *req, struct evbuffer *evbuf, char **u
|
|||||||
const char *cuequery;
|
const char *cuequery;
|
||||||
const char *param;
|
const char *param;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
|
int clear;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* /cue?command=play&query=...&sort=...&index=N */
|
/* /cue?command=play&query=...&sort=...&index=N */
|
||||||
|
|
||||||
|
param = evhttp_find_header(query, "clear-first");
|
||||||
|
if (param)
|
||||||
|
{
|
||||||
|
ret = safe_atoi32(param, &clear);
|
||||||
|
if (ret < 0)
|
||||||
|
DPRINTF(E_LOG, L_DACP, "Invalid clear-first value in cue request\n");
|
||||||
|
else if (clear)
|
||||||
|
{
|
||||||
|
player_playback_stop();
|
||||||
|
|
||||||
|
player_queue_clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cuequery = evhttp_find_header(query, "query");
|
cuequery = evhttp_find_header(query, "query");
|
||||||
if (cuequery)
|
if (cuequery)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user