misc.anonradio: handle up next entries better

This commit is contained in:
Cynthia Foxwell 2022-08-16 14:40:19 -06:00
parent 85eef5667a
commit 5e972b8fe7

View file

@ -316,11 +316,15 @@ anonradio.callback = async function (msg, line) {
`${DAYS[targetDay]}, ${currentYear}-${targetMonth}-${targetDateDay} ${hour} UTC` `${DAYS[targetDay]}, ${currentYear}-${targetMonth}-${targetDateDay} ${hour} UTC`
) / 1000; ) / 1000;
parsedLines.push({timestamp, id, name}); parsedLines.push({timestamp, id, name: name.replace(" <- Up NEXT", "")});
} }
const liveNow = parsedLines.splice(0, 1)[0]; let liveNow = {name: "ident", id: "aNONradio"};
if (parsedLines[0].name.includes("<- Live NOW")) {
liveNow = parsedLines.splice(0, 1)[0];
liveNow.name = liveNow.name.replace(" <- Live NOW", ""); liveNow.name = liveNow.name.replace(" <- Live NOW", "");
}
let title = ""; let title = "";
let subtitle = ""; let subtitle = "";