anonradio: null checks
This commit is contained in:
parent
0936ce6937
commit
e212bade7b
1 changed files with 6 additions and 1 deletions
|
@ -68,9 +68,14 @@ async function updateNowPlaying() {
|
||||||
} else if (playing.startsWith("Coming up")) {
|
} else if (playing.startsWith("Coming up")) {
|
||||||
title = playing;
|
title = playing;
|
||||||
} else {
|
} else {
|
||||||
const [_, current, peakDay, peakMonth, dj, metadata] = playing.match(
|
const metadataLine = playing.match(
|
||||||
/\[(\d+)\/(\d+)\/(\d+)\] \((.+?)\): (.+)/
|
/\[(\d+)\/(\d+)\/(\d+)\] \((.+?)\): (.+)/
|
||||||
);
|
);
|
||||||
|
const current = metadataLine?.[1] ?? "??";
|
||||||
|
const peakDay = metadataLine?.[2] ?? "??";
|
||||||
|
const peakMonth = metadataLine?.[3] ?? "??";
|
||||||
|
const dj = metadataLine?.[4] ?? "unknown";
|
||||||
|
const metadata = metadataLine?.[5] ?? "unknown";
|
||||||
|
|
||||||
if (
|
if (
|
||||||
metadata == "https://archives.anonradio.net" ||
|
metadata == "https://archives.anonradio.net" ||
|
||||||
|
|
Loading…
Reference in a new issue