diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-10-15 04:13:13 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-10-15 04:13:13 +0300 |
commit | 3ce8cb83dda0029f675f68110177c314a7346f1a (patch) | |
tree | 66572397833e5d1f50a6cb4a07a1b582f1e92ae2 /client/js | |
parent | 3e5fbc779b30607d3eedb8fdbd7ddbee9f65bcf0 (diff) | |
download | arching-kaos-radio-3ce8cb83dda0029f675f68110177c314a7346f1a.tar.gz arching-kaos-radio-3ce8cb83dda0029f675f68110177c314a7346f1a.tar.bz2 arching-kaos-radio-3ce8cb83dda0029f675f68110177c314a7346f1a.zip |
Possible fix
Diffstat (limited to 'client/js')
-rw-r--r-- | client/js/radio_emulator.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/js/radio_emulator.js b/client/js/radio_emulator.js index 9ea8324..2787cba 100644 --- a/client/js/radio_emulator.js +++ b/client/js/radio_emulator.js @@ -297,7 +297,7 @@ function listCallback(json, params) 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 ( json.list[i].starts_on < values.now_on_sequence && values.now_on_sequence < json.list[i+1].starts_on && i < json.list.length - 2) { values.now_on_sequence = values.now_on_sequence - json.list[i].starts_on; debugLog(`now_on_sequence (1updated): ${values.now_on_sequence}`); @@ -305,7 +305,7 @@ function listCallback(json, params) debugLog('First!'); break; } - else if ( values.now_on_sequence > json.list[i].starts_on && i === json.list.length - 1 ) + else if ( values.now_on_sequence > json.list[i].starts_on && i === json.list.length - 2 ) { 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]); |