anonradio: fix timer dying
This commit is contained in:
parent
ea18e21d42
commit
5b04ce97a9
1 changed files with 8 additions and 2 deletions
|
@ -38,13 +38,19 @@ async function updateNowPlaying() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!playing || !schedule) return;
|
||||
if (!playing || !schedule) {
|
||||
hf.__anonradio_timeout = setTimeout(updateNowPlaying, 2000);
|
||||
return;
|
||||
}
|
||||
|
||||
let lines = schedule.split("\n");
|
||||
lines = lines.slice(4, lines.length - 2);
|
||||
const line = lines[0];
|
||||
|
||||
if (!line) return;
|
||||
if (!line) {
|
||||
hf.__anonradio_timeout = setTimeout(updateNowPlaying, 2000);
|
||||
return;
|
||||
}
|
||||
|
||||
const [_, _time, id, name] = line.match(/^(.{3,4} .{4})\s+(.+?) {2}(.+?)$/);
|
||||
|
||||
|
|
Loading…
Reference in a new issue