mirror of
https://github.com/tomru/advcal.git
synced 2026-03-03 14:37:19 +01:00
124 lines
3.2 KiB
JavaScript
124 lines
3.2 KiB
JavaScript
const { DateTime } = require("luxon");
|
||
|
||
const SONGS = [
|
||
{
|
||
"id": "2HkJHApgKqw",
|
||
"title": "Jona Lewie - Stop The Cavalry"
|
||
},
|
||
{
|
||
"id": "-boCKJsDe5U",
|
||
"title": "Die Moorsoldaten"
|
||
},
|
||
{
|
||
"id": "igNVdlXhKcI",
|
||
"title": "Charlie Puth - Marvin Gaye ft. Meghan Trainor [Official Video]"
|
||
},
|
||
{
|
||
"id": "oGmJzzSENGg",
|
||
"title": "I'm not dreaming of the white Christmas Gilbert O'sullivan FullHD Diego Gil"
|
||
},
|
||
{
|
||
"id": "zXeRB-3nDR8",
|
||
"title": "The Small Faces - Lazy Sunday Afternoon"
|
||
},
|
||
{
|
||
"id": "qP-7GNoDJ5c",
|
||
"title": "Nathan Evans - Wellerman (Sea Shanty)"
|
||
},
|
||
{
|
||
"id": "uuicMkCXXTw",
|
||
"title": "BELLA CIAO - TriGO! (La Casa de Papel)"
|
||
},
|
||
{
|
||
"id": "zHfQcy1ol68",
|
||
"title": "Es wollt ein Bauer früh aufstehn"
|
||
},
|
||
{
|
||
"id": "xCiQXsvPr1M",
|
||
"title": "Jake Bugg - Lightning Bolt (Official Video)"
|
||
},
|
||
{
|
||
"id": "VUosAGDM8Sg",
|
||
"title": "Die Fantastischen Vier - Die Da ?! (Original HQ)"
|
||
},
|
||
{
|
||
"id": "ja3oDIYNPkU",
|
||
"title": "ZAZ - La Pluie (with lyrics)"
|
||
},
|
||
{
|
||
"id": "ZOBvRs4btvE",
|
||
"title": "Ed Sheeran & Anne-Marie - Fairytale Of New York in the Live Lounge"
|
||
},
|
||
{
|
||
"id": "LRPILZS1hc8",
|
||
"title": "Wayne Newton - Danke Schoen (1968) Live"
|
||
},
|
||
{
|
||
"id": "mP07Oyr7enQ",
|
||
"title": "The Beach Boys - Kokomo (LYRICS)"
|
||
},
|
||
{
|
||
"id": "byQIPdHMpjc",
|
||
"title": "Billy Ray Cyrus - Achy Breaky Heart (Official Music Video)"
|
||
},
|
||
{
|
||
"id": "X6CkQkcY1cs",
|
||
"title": "Tschu Tschu wa - Singen, Tanzen und Bewegen || Kinderlieder"
|
||
},
|
||
{
|
||
"id": "KNZH-emehxA",
|
||
"title": "Shania Twain - You’re Still The One (Official Music Video)"
|
||
},
|
||
{
|
||
"id": "kle2xHhRHg4",
|
||
"title": "The Beatles - Eight Days A Week"
|
||
},
|
||
{
|
||
"id": "V1bFr2SWP1I",
|
||
"title": "OFFICIAL Somewhere over the Rainbow - Israel \"IZ\" Kamakawiwoʻole"
|
||
},
|
||
{
|
||
"id": "Q_oFL_b719g",
|
||
"title": "You Don't Own Me - Bette Midler, Goldie Hawn & Diane Keaton"
|
||
},
|
||
{
|
||
"id": "BtLqmWt2h2g",
|
||
"title": "Shaggy - Oh Carolina 1993 (Official HQ)"
|
||
},
|
||
{
|
||
"id": "yAEFKjqPtlU",
|
||
"title": "The Irish Rover - The Dubliners &The Pogues"
|
||
},
|
||
{
|
||
"id": "tLyw7jytykE",
|
||
"title": "Sandi Thom - I Wish I Was A Punk Rocker (Official Video)"
|
||
},
|
||
{
|
||
"id": "OcjS48xnjks",
|
||
"title": "Die Priester - Engel auf den Feldern singen (Gloria in Excelsis Deo) 2012"
|
||
}
|
||
|
||
];
|
||
|
||
export default async (req, res) => {
|
||
const unlocked = req.query.unlock === 'true';
|
||
const NOW = DateTime.utc().setZone("Europe/Berlin");
|
||
|
||
const getLockedData = (index) => {
|
||
const dayString = ("00" + (index + 1)).substr(-2, 2);
|
||
const lockedUntilDateTime = DateTime.fromISO(
|
||
`${NOW.year}-12-${dayString}T00:00:00.000+01:00`
|
||
);
|
||
return {
|
||
locked: unlocked ? false : NOW < lockedUntilDateTime,
|
||
lockedUntil: lockedUntilDateTime.toISO(),
|
||
};
|
||
};
|
||
|
||
const songs = SONGS.map((item, index) => ({
|
||
...item,
|
||
...getLockedData(index),
|
||
}));
|
||
res.json({ songs });
|
||
};
|