From 589238e623c44c66cfd0b6d5f6da3f5f2cf707e3 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Tue, 15 Oct 2024 03:58:59 +0300 Subject: Possible fix --- client/js/radio_emulator.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/client/js/radio_emulator.js b/client/js/radio_emulator.js index ac2299a..12e6c67 100644 --- a/client/js/radio_emulator.js +++ b/client/js/radio_emulator.js @@ -294,23 +294,19 @@ function listCallback(json, params) { for ( var i = 0; i < json.list.length - 1; i++) { + if( i !== 0) appendPreviouslyPlayedShows(json.list[i-1]); debugLog("getting there " + i) debugLog(`${json.list[i].starts_on} < ${values.now_on_sequence} < ${json.list[i+1].starts_on}`); if ( json.list[i].starts_on < values.now_on_sequence && values.now_on_sequence < json.list[i+1].starts_on ) { - if( i !== 0) - { - appendPreviouslyPlayedShows(json.list[i-1]); - } values.now_on_sequence = values.now_on_sequence - json.list[i].starts_on; debugLog(`now_on_sequence (1updated): ${values.now_on_sequence}`); FetchJSON(`${jsonRequest}${json.list[i].hash}`, loadShowCallback, [json, values.now_on_sequence, json.list[i], hash_of_list]); debugLog('First!'); break; } - else if ( values.now_on_sequence < json.list[i].starts_on ) + else if ( values.now_on_sequence > json.list[i].starts_on && values.now_on_sequence > json.list[i].starts_on) { - 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!'); @@ -318,7 +314,6 @@ function listCallback(json, params) } else { - // values.now_on_sequence = values.now_on_sequence - json.list[i].starts_on; debugLog(`We are here: ${i}`); debugLog(values.now_on_sequence); debugLog(json.list[i].starts_on); -- cgit v1.2.3