From 234287650c5c4fbf0ab78e4a3578de4c6c50f5f3 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Tue, 15 Oct 2024 03:55:36 +0300 Subject: Debug --- client/js/radio_emulator.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client/js/radio_emulator.js') diff --git a/client/js/radio_emulator.js b/client/js/radio_emulator.js index 4b4fdf9..ac2299a 100644 --- a/client/js/radio_emulator.js +++ b/client/js/radio_emulator.js @@ -308,11 +308,11 @@ function listCallback(json, params) debugLog('First!'); break; } - else if ( values.now_on_sequence > json.list[i].starts_on && values.now_on_sequence > json.list[i+1].starts_on ) + else if ( values.now_on_sequence < json.list[i].starts_on ) { - appendPreviouslyPlayedShows(json.list[i]); - values.now_on_sequence = values.now_on_sequence - json.list[i+1].starts_on; - FetchJSON(`${jsonRequest}${json.list[i+1].hash}`, loadShowCallback, [json, values.now_on_sequence, json.list[i+1], hash_of_list]); + if ( i !== 0 ) appendPreviouslyPlayedShows(json.list[i-1]); + values.now_on_sequence = values.now_on_sequence - json.list[i].starts_on; + FetchJSON(`${jsonRequest}${json.list[i].hash}`, loadShowCallback, [json, values.now_on_sequence, json.list[i], hash_of_list]); debugLog('Second!'); break; } -- cgit v1.2.3