diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/js/radio_emulator.js | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |