misc.anonradio: better replace

This commit is contained in:
Cynthia Foxwell 2022-09-09 21:18:21 -06:00
parent e09d605699
commit 148dd207b9

View file

@ -321,7 +321,19 @@ anonradio.callback = async function (msg, line) {
`${DAYS[targetDay]}, ${currentYear}-${targetMonth}-${targetDateDay} ${hour} UTC`
) / 1000;
parsedLines.push({timestamp, id, name: name.replace(" <- Up NEXT", "")});
let nameOut = name;
if (time == "Sat 0300")
nameOut = name.replace(
"Open Mic - Anyone can stream",
"Synth Battle Royale"
);
parsedLines.push({
timestamp,
id,
name: nameOut.replace(" <- Up NEXT", ""),
});
}
let liveNow = {name: "ident", id: "aNONradio"};
@ -331,18 +343,6 @@ anonradio.callback = async function (msg, line) {
liveNow.name = liveNow.name.replace(" <- Live NOW", "");
}
const currentHour = now.getUTCHour();
const currentDay = now.getUTCDay();
// sbr only ever lasts 2 hours on average
if (
currentDay == 6 &&
currentHour >= 3 &&
currentHour <= 5 &&
liveNow.id == "openmic"
) {
liveNow.name = "Synth Battle Royale";
}
let title = "";
let subtitle = "";