mirror of
https://github.com/SuperBFG7/ympd
synced 2024-12-27 19:30:27 +00:00
Use queue version for song change in http streams
This commit is contained in:
parent
332855bcf4
commit
d674ae5f13
@ -114,11 +114,11 @@ app.route=function() {
|
|||||||
app.current.filter = params[6];
|
app.current.filter = params[6];
|
||||||
app.current.search = params[7];
|
app.current.search = params[7];
|
||||||
} else {
|
} else {
|
||||||
app.goto("Playback");
|
app.goto("Playback");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
app.prepare();
|
app.prepare();
|
||||||
|
|
||||||
if (app.current.app == 'Playback') {
|
if (app.current.app == 'Playback') {
|
||||||
socket.send('MPD_API_GET_CURRENT_SONG');
|
socket.send('MPD_API_GET_CURRENT_SONG');
|
||||||
}
|
}
|
||||||
@ -672,8 +672,9 @@ function webSocketConnect() {
|
|||||||
$('#QueueList > tbody > tr[trackid='+obj.data.currentsongid+'] > td').eq(4).text(counterText);
|
$('#QueueList > tbody > tr[trackid='+obj.data.currentsongid+'] > td').eq(4).text(counterText);
|
||||||
$('#QueueList > tbody > tr[trackid='+obj.data.currentsongid+'] > td').eq(0).addClass('material-icons').text('play_arrow');
|
$('#QueueList > tbody > tr[trackid='+obj.data.currentsongid+'] > td').eq(0).addClass('material-icons').text('play_arrow');
|
||||||
$('#QueueList > tbody > tr[trackid='+obj.data.currentsongid+']').addClass('active').addClass("font-weight-bold");
|
$('#QueueList > tbody > tr[trackid='+obj.data.currentsongid+']').addClass('active').addClass("font-weight-bold");
|
||||||
if ($('#currenttrack').text() != $('#QueueList > tbody > tr[trackid='+obj.data.currentsongid+'] > td').eq(1).text()) {
|
|
||||||
//Get current song on queue change for http streams
|
//Get current song on queue change for http streams
|
||||||
|
if (last_state == undefined || obj.data.queue_version != last_state.data.queue_version) {
|
||||||
socket.send('MPD_API_GET_CURRENT_SONG');
|
socket.send('MPD_API_GET_CURRENT_SONG');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,7 +709,8 @@ int mpd_put_state(char *buffer, int *current_song_id, int *next_song_id, unsign
|
|||||||
"\"state\":%d, \"volume\":%d, \"songpos\": %d, \"elapsedTime\": %d, "
|
"\"state\":%d, \"volume\":%d, \"songpos\": %d, \"elapsedTime\": %d, "
|
||||||
"\"totalTime\":%d, \"currentsongid\": %d, \"kbitrate\": %d, "
|
"\"totalTime\":%d, \"currentsongid\": %d, \"kbitrate\": %d, "
|
||||||
"\"audioformat\": { \"sample_rate\": %d, \"bits\": %d, \"channels\": %d}, "
|
"\"audioformat\": { \"sample_rate\": %d, \"bits\": %d, \"channels\": %d}, "
|
||||||
"\"queue_length\": %d, \"nextsongpos\": %d, \"nextsongid\": %d"
|
"\"queue_length\": %d, \"nextsongpos\": %d, \"nextsongid\": %d, "
|
||||||
|
"\"queue_version\": %d"
|
||||||
"}}",
|
"}}",
|
||||||
mpd_status_get_state(status),
|
mpd_status_get_state(status),
|
||||||
mpd_status_get_volume(status),
|
mpd_status_get_volume(status),
|
||||||
@ -723,7 +724,8 @@ int mpd_put_state(char *buffer, int *current_song_id, int *next_song_id, unsign
|
|||||||
audioformat ? audioformat->channels : 0,
|
audioformat ? audioformat->channels : 0,
|
||||||
mpd_status_get_queue_length(status),
|
mpd_status_get_queue_length(status),
|
||||||
mpd_status_get_next_song_pos(status),
|
mpd_status_get_next_song_pos(status),
|
||||||
mpd_status_get_next_song_id(status)
|
mpd_status_get_next_song_id(status),
|
||||||
|
mpd_status_get_queue_version(status)
|
||||||
);
|
);
|
||||||
|
|
||||||
*current_song_id = mpd_status_get_song_id(status);
|
*current_song_id = mpd_status_get_song_id(status);
|
||||||
|
Loading…
Reference in New Issue
Block a user