mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-29 08:33:23 -05:00
Add version number for playlist (queue)
This is necessary to return a valid playlist id for mpd status command.
This commit is contained in:
parent
aa4a12cabe
commit
3886ec6638
@ -790,7 +790,7 @@ mpd_command_status(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
|||||||
status.shuffle,
|
status.shuffle,
|
||||||
(status.repeat == REPEAT_SONG ? 1 : 0),
|
(status.repeat == REPEAT_SONG ? 1 : 0),
|
||||||
0 /* consume: not supported by forked-daapd, always return 'off' */,
|
0 /* consume: not supported by forked-daapd, always return 'off' */,
|
||||||
status.plid,
|
status.plversion,
|
||||||
status.playlistlength,
|
status.playlistlength,
|
||||||
state);
|
state);
|
||||||
|
|
||||||
@ -1815,6 +1815,7 @@ mpd_command_playlistinfo(struct evbuffer *evbuf, int argc, char **argv, char **e
|
|||||||
static int
|
static int
|
||||||
mpd_command_plchanges(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
mpd_command_plchanges(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
||||||
{
|
{
|
||||||
|
DPRINTF(E_WARN, L_MPD, "Ignore command %s\n", argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
src/player.c
12
src/player.c
@ -256,6 +256,7 @@ static struct player_source *shuffle_head;
|
|||||||
static struct player_source *cur_playing;
|
static struct player_source *cur_playing;
|
||||||
static struct player_source *cur_streaming;
|
static struct player_source *cur_streaming;
|
||||||
static uint32_t cur_plid;
|
static uint32_t cur_plid;
|
||||||
|
static uint32_t cur_plversion;
|
||||||
static struct evbuffer *audio_buf;
|
static struct evbuffer *audio_buf;
|
||||||
|
|
||||||
/* Play history */
|
/* Play history */
|
||||||
@ -2513,6 +2514,7 @@ get_status(struct player_command *cmd)
|
|||||||
status->volume = master_volume;
|
status->volume = master_volume;
|
||||||
|
|
||||||
status->plid = cur_plid;
|
status->plid = cur_plid;
|
||||||
|
status->plversion = cur_plversion;
|
||||||
|
|
||||||
switch (player_state)
|
switch (player_state)
|
||||||
{
|
{
|
||||||
@ -3870,6 +3872,7 @@ queue_add(struct player_command *cmd)
|
|||||||
|
|
||||||
if (cur_plid != 0)
|
if (cur_plid != 0)
|
||||||
cur_plid = 0;
|
cur_plid = 0;
|
||||||
|
cur_plversion++;
|
||||||
|
|
||||||
listener_notify(LISTENER_PLAYLIST);
|
listener_notify(LISTENER_PLAYLIST);
|
||||||
|
|
||||||
@ -3913,6 +3916,7 @@ queue_add_next(struct player_command *cmd)
|
|||||||
|
|
||||||
if (cur_plid != 0)
|
if (cur_plid != 0)
|
||||||
cur_plid = 0;
|
cur_plid = 0;
|
||||||
|
cur_plversion++;
|
||||||
|
|
||||||
listener_notify(LISTENER_PLAYLIST);
|
listener_notify(LISTENER_PLAYLIST);
|
||||||
|
|
||||||
@ -3983,6 +3987,8 @@ queue_move(struct player_command *cmd)
|
|||||||
ps_dst->pl_next = ps_src;
|
ps_dst->pl_next = ps_src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_plversion++;
|
||||||
|
|
||||||
listener_notify(LISTENER_PLAYLIST);
|
listener_notify(LISTENER_PLAYLIST);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -4050,6 +4056,8 @@ queue_remove(struct player_command *cmd)
|
|||||||
|
|
||||||
source_free(ps);
|
source_free(ps);
|
||||||
|
|
||||||
|
cur_plversion++;
|
||||||
|
|
||||||
listener_notify(LISTENER_PLAYLIST);
|
listener_notify(LISTENER_PLAYLIST);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -4077,6 +4085,7 @@ queue_clear(struct player_command *cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_plid = 0;
|
cur_plid = 0;
|
||||||
|
cur_plversion++;
|
||||||
|
|
||||||
listener_notify(LISTENER_PLAYLIST);
|
listener_notify(LISTENER_PLAYLIST);
|
||||||
|
|
||||||
@ -4129,6 +4138,8 @@ queue_empty(struct player_command *cmd)
|
|||||||
source_head->shuffle_prev = source_head;
|
source_head->shuffle_prev = source_head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_plversion++;
|
||||||
|
|
||||||
listener_notify(LISTENER_PLAYLIST);
|
listener_notify(LISTENER_PLAYLIST);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -5189,6 +5200,7 @@ player_init(void)
|
|||||||
cur_playing = NULL;
|
cur_playing = NULL;
|
||||||
cur_streaming = NULL;
|
cur_streaming = NULL;
|
||||||
cur_plid = 0;
|
cur_plid = 0;
|
||||||
|
cur_plversion = 0;
|
||||||
|
|
||||||
player_state = PLAY_STOPPED;
|
player_state = PLAY_STOPPED;
|
||||||
repeat = REPEAT_OFF;
|
repeat = REPEAT_OFF;
|
||||||
|
@ -54,6 +54,8 @@ struct player_status {
|
|||||||
|
|
||||||
/* Playlist id */
|
/* Playlist id */
|
||||||
uint32_t plid;
|
uint32_t plid;
|
||||||
|
/* Playlist version */
|
||||||
|
uint32_t plversion;
|
||||||
/* Playlist length */
|
/* Playlist length */
|
||||||
uint32_t playlistlength;
|
uint32_t playlistlength;
|
||||||
/* Playing song id*/
|
/* Playing song id*/
|
||||||
|
Loading…
Reference in New Issue
Block a user