mirror of
				https://github.com/SuperBFG7/ympd
				synced 2025-10-30 21:33:00 +00:00 
			
		
		
		
	Use queue version for song change in http streams
This commit is contained in:
		| @@ -115,10 +115,10 @@ app.route=function() { | ||||
|       app.current.search = params[7]; | ||||
|     } else { | ||||
|       app.goto("Playback"); | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     app.prepare(); | ||||
|  | ||||
|     if (app.current.app == 'Playback') { | ||||
|       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(0).addClass('material-icons').text('play_arrow'); | ||||
|                     $('#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 | ||||
|                     if (last_state == undefined || obj.data.queue_version != last_state.data.queue_version) { | ||||
|                       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, " | ||||
|         "\"totalTime\":%d, \"currentsongid\": %d, \"kbitrate\": %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_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, | ||||
|         mpd_status_get_queue_length(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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jcorporation
					jcorporation