[mpd] Implement command 'plchangesposid'
This commit is contained in:
parent
b84df9c5c3
commit
4878dce0b0
42
src/mpd.c
42
src/mpd.c
|
@ -2020,6 +2020,46 @@ mpd_command_plchanges(struct evbuffer *evbuf, int argc, char **argv, char **errm
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Command handler function for 'plchangesposid'
|
||||||
|
* Lists all changed songs in the queue since the given playlist version in argv[1] without metadata.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
mpd_command_plchangesposid(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
||||||
|
{
|
||||||
|
struct queue *queue;
|
||||||
|
struct queue_item *item;
|
||||||
|
int count;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* forked-daapd does not keep track of changes in the queue based on the playlist version,
|
||||||
|
* therefor plchangesposid returns all songs in the queue as changed ignoring the given version.
|
||||||
|
*/
|
||||||
|
queue = player_queue_get_byindex(0, 0);
|
||||||
|
|
||||||
|
if (!queue)
|
||||||
|
{
|
||||||
|
// Queue is emtpy
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
count = queue_count(queue);
|
||||||
|
for (i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
item = queue_get_byindex(queue, i, 0);
|
||||||
|
|
||||||
|
evbuffer_add_printf(evbuf,
|
||||||
|
"cpos: %d\n"
|
||||||
|
"Id: %d\n",
|
||||||
|
i,
|
||||||
|
queueitem_item_id(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
queue_free(queue);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Command handler function for 'listplaylist'
|
* Command handler function for 'listplaylist'
|
||||||
* Lists all songs in the playlist given by virtual-path in argv[1].
|
* Lists all songs in the playlist given by virtual-path in argv[1].
|
||||||
|
@ -3827,11 +3867,11 @@ static struct command mpd_handlers[] =
|
||||||
.mpdcommand = "plchanges",
|
.mpdcommand = "plchanges",
|
||||||
.handler = mpd_command_plchanges
|
.handler = mpd_command_plchanges
|
||||||
},
|
},
|
||||||
/*
|
|
||||||
{
|
{
|
||||||
.mpdcommand = "plchangesposid",
|
.mpdcommand = "plchangesposid",
|
||||||
.handler = mpd_command_plchangesposid
|
.handler = mpd_command_plchangesposid
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
{
|
{
|
||||||
.mpdcommand = "prio",
|
.mpdcommand = "prio",
|
||||||
.handler = mpd_command_prio
|
.handler = mpd_command_prio
|
||||||
|
|
Loading…
Reference in New Issue