Start the service
One button that opens the screen, puts the first song of the queue on air and tells the band.
Permissions: display.control, output.control, queue.read, songs.control, stage.control, notifications
import { defineScript, lyrius } from "@lyrius/script-sdk";
// One button (or shortcut) that gets everything ready to start the service.
export default defineScript({
async main() {
await lyrius.displays.public.open(); // opens the main screen
await lyrius.output.live();
const [first] = (await lyrius.queue.list()).filter((item) => item.songId);
if (!first?.songId) {
await lyrius.ui.notify({ type: "warning", message: "The queue has no songs." });
return;
}
await lyrius.songs.show(first.songId);
await lyrius.stage.message(`Starting: ${first.title}`);
},
});