diff --git a/src/modules/anonradio.js b/src/modules/anonradio.js index b280342..364c14b 100644 --- a/src/modules/anonradio.js +++ b/src/modules/anonradio.js @@ -68,9 +68,14 @@ async function updateNowPlaying() { } else if (playing.startsWith("Coming up")) { title = playing; } else { - const [_, current, peakDay, peakMonth, dj, metadata] = playing.match( + const metadataLine = playing.match( /\[(\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 ( metadata == "https://archives.anonradio.net" ||