mirror of
https://github.com/tomru/advcal.git
synced 2026-03-03 06:27:17 +01:00
124 lines
2.9 KiB
JavaScript
124 lines
2.9 KiB
JavaScript
const { DateTime } = require("luxon");
|
||
|
||
const SONGS = [
|
||
{
|
||
"id": "qmPqIcqGDYk",
|
||
"title": "Mumford & Sons \"Winter Winds\" Directors Cut"
|
||
},
|
||
{
|
||
"id": "yIyUkZ-vIhU",
|
||
"title": "Tom Walker - Leave a Light On | Infinito Violin Duo"
|
||
},
|
||
{
|
||
"id": "_jTdnCbWJQE",
|
||
"title": "Alan Jackson - You Can Always Come Home (Lyric Video)"
|
||
},
|
||
{
|
||
"id": "ZM5qIJdBtX0",
|
||
"title": "Cher - The Shoop Shoop Song (It's In His Kiss) (Alternate Version) (Official Music Video)"
|
||
},
|
||
{
|
||
"id": "WJ0uJo5kJ04",
|
||
"title": "Rolf Zuckowski | Die Jahresuhr (Lyric Video)"
|
||
},
|
||
{
|
||
"id": "NTY41o6ugX0",
|
||
"title": "Lo & Leduc: 079 | Die grössten Schweizer Hits | SRF Musik"
|
||
},
|
||
{
|
||
"id": "7JlDXrt4Ne0",
|
||
"title": "(Le Pingouin Judoka) - Ponga"
|
||
},
|
||
{
|
||
"id": "fJ9rUzIMcZQ",
|
||
"title": "Queen – Bohemian Rhapsody (Official Video Remastered)"
|
||
},
|
||
{
|
||
"id": "Q4wb11w0ZHQ",
|
||
"title": "Ravel - Bolero (original version)"
|
||
},
|
||
{
|
||
"id": "7PCkvCPvDXk",
|
||
"title": "Meghan Trainor - All About That Bass (Official Video)"
|
||
},
|
||
{
|
||
"id": "lgeUItUZjj4",
|
||
"title": "Gipsy Kings - Baila Me (Official Video)"
|
||
},
|
||
{
|
||
"id": "zWaymcVmJ-A",
|
||
"title": "Los Del Rio - Macarena (Bayside Boys Remix)"
|
||
},
|
||
{
|
||
"id": "ly6BHDlCL38",
|
||
"title": "I like to Move it-Madagascar"
|
||
},
|
||
{
|
||
"id": "0GsajWIF3ws",
|
||
"title": "Swan Lake – Dance of the cygnets (The Royal Ballet)"
|
||
},
|
||
{
|
||
"id": "di8_3C447CU",
|
||
"title": "Freddy Kalas Hey Ho Lyrics"
|
||
},
|
||
{
|
||
"id": "IDBVW4BXZPo",
|
||
"title": "Blue Bayou"
|
||
},
|
||
{
|
||
"id": "6pYI9t-I6qo",
|
||
"title": "The Pogues - Fiesta"
|
||
},
|
||
{
|
||
"id": "amk7AiEI43I",
|
||
"title": "Bryan Adams - Christmas Time (Classic Version)"
|
||
},
|
||
{
|
||
"id": "HGVNzgUxE-g",
|
||
"title": "Barenaked Ladies - \"God Rest Ye Merry Gentlemen/We Three Kings\" Feat. Sarah McLachlan"
|
||
},
|
||
{
|
||
"id": "klFMGWb8x6A",
|
||
"title": "The Archies - Sugar, Sugar (Official Video)"
|
||
},
|
||
{
|
||
"id": "_UFUcqXQd-4",
|
||
"title": "FRANK ZANDER - Oh, Susi (Der zensierte Song)"
|
||
},
|
||
{
|
||
"id": "SmctKnIYWF0",
|
||
"title": "Peter Alexander - Der Papa wird's schon richten (WWF-Club 30.10.1981)"
|
||
},
|
||
{
|
||
"id": "ZUVVHZsatL8",
|
||
"title": "Zwei kleine Italiener"
|
||
},
|
||
{
|
||
"id": "InJnd0twFcQ",
|
||
"title": "Anne Kaffeekanne"
|
||
}
|
||
];
|
||
|
||
|
||
export default async function getSongs(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 });
|
||
};
|