aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-10-15 03:58:59 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-10-15 03:58:59 +0300
commit589238e623c44c66cfd0b6d5f6da3f5f2cf707e3 (patch)
tree3ca22380ad64e29fc67023cdb3f7021c29d8c58e
parent234287650c5c4fbf0ab78e4a3578de4c6c50f5f3 (diff)
downloadarching-kaos-radio-589238e623c44c66cfd0b6d5f6da3f5f2cf707e3.tar.gz
arching-kaos-radio-589238e623c44c66cfd0b6d5f6da3f5f2cf707e3.tar.bz2
arching-kaos-radio-589238e623c44c66cfd0b6d5f6da3f5f2cf707e3.zip
Possible fix
-rw-r--r--client/js/radio_emulator.js9
1 files 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);