refactor: restructure model to contain an object of rundowns

This commit is contained in:
Carlos Valente
2025-03-15 09:04:33 +01:00
parent 433e9f6a4f
commit dbf8eeb7fb
111 changed files with 4366 additions and 4612 deletions
+3 -3
View File
@@ -2,8 +2,8 @@ import { test, expect } from '@playwright/test';
import { readFile } from 'fs/promises';
const fileToUpload = 'e2e/tests/fixtures/test-db.json';
const fileToDownload = 'e2e/tests/fixtures/tmp/test-db.json';
const fileToUpload = 'e2e/tests/fixtures/e2e-test-db.json';
const fileToDownload = 'e2e/tests/fixtures/tmp/e2e-test-db.json';
test('project file upload', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
@@ -46,7 +46,7 @@ test('project file download', async ({ page }) => {
const downloadPromise = page.waitForEvent('download');
await page
.getByRole('row', { name: RegExp('^test-db') })
.getByRole('row', { name: /^e2e-test-db/ })
.getByLabel('Options')
.click();
await page.getByRole('menuitem', { name: 'Download' }).click();
+519
View File
@@ -0,0 +1,519 @@
{
"rundowns": {
"demo": {
"id": "demo",
"title": "Eurovision Demo",
"order": [
"32d31",
"21cd2",
"0b371",
"3cd28",
"e457f",
"01e85",
"1c420",
"b7737",
"d3a80",
"8276c",
"2340b",
"cb90b",
"503c4",
"5e965",
"bab4a",
"d3eb1"
],
"entries": {
"32d31": {
"type": "event",
"id": "32d31",
"cue": "SF1.01",
"title": "Albania",
"note": "SF1.01",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 36000000,
"timeEnd": 37200000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 0,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Sekret",
"artist": "Ronela Hajati"
}
},
"21cd2": {
"type": "event",
"id": "21cd2",
"cue": "SF1.02",
"title": "Latvia",
"note": "SF1.02",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 37500000,
"timeEnd": 38700000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Eat Your Salad",
"artist": "Citi Zeni"
}
},
"0b371": {
"type": "event",
"id": "0b371",
"cue": "SF1.03",
"title": "Lithuania",
"note": "SF1.03",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 39000000,
"timeEnd": 40200000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Sentimentai",
"artist": "Monika Liu"
}
},
"3cd28": {
"type": "event",
"id": "3cd28",
"cue": "SF1.04",
"title": "Switzerland",
"note": "SF1.04",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 40500000,
"timeEnd": 41700000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Boys Do Cry",
"artist": "Marius Bear"
}
},
"e457f": {
"type": "event",
"id": "e457f",
"cue": "SF1.05",
"title": "Slovenia",
"note": "SF1.05",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 42000000,
"timeEnd": 43200000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Disko",
"artist": "LPS"
}
},
"01e85": {
"type": "block",
"id": "01e85",
"title": "Lunch break",
"note": "",
"colour": "",
"events": [],
"skip": false,
"custom": {},
"revision": 0,
"startTime": null,
"endTime": null,
"duration": 0,
"isFirstLinked": false,
"numEvents": 0
},
"1c420": {
"type": "event",
"id": "1c420",
"cue": "SF1.06",
"title": "Ukraine",
"note": "SF1.06",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 47100000,
"timeEnd": 48300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 3900000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Stefania",
"artist": "Kalush Orchestra"
}
},
"b7737": {
"type": "event",
"id": "b7737",
"cue": "SF1.07",
"title": "Bulgaria",
"note": "SF1.07",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 48600000,
"timeEnd": 49800000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Intention",
"artist": "Intelligent Music Project"
}
},
"d3a80": {
"type": "event",
"id": "d3a80",
"cue": "SF1.08",
"title": "Netherlands",
"note": "SF1.08",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 50100000,
"timeEnd": 51300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "De Diepte",
"artist": "S10"
}
},
"8276c": {
"type": "event",
"id": "8276c",
"cue": "SF1.09",
"title": "Moldova",
"note": "SF1.09",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 51600000,
"timeEnd": 52800000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Trenuletul",
"artist": "Zdob si Zdub"
}
},
"2340b": {
"type": "event",
"id": "2340b",
"cue": "SF1.10",
"title": "Portugal",
"note": "SF1.10",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 53100000,
"timeEnd": 54300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Saudade Saudade",
"artist": "Maro"
}
},
"cb90b": {
"type": "block",
"id": "cb90b",
"title": "Afternoon break",
"note": "",
"colour": "",
"events": [],
"skip": false,
"custom": {},
"revision": 0,
"startTime": null,
"endTime": null,
"duration": 0,
"isFirstLinked": false,
"numEvents": 0
},
"503c4": {
"type": "event",
"id": "503c4",
"cue": "SF1.11",
"title": "Croatia",
"note": "SF1.11",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 56100000,
"timeEnd": 57300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 1800000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Guilty Pleasure",
"artist": "Mia Dimsic"
}
},
"5e965": {
"type": "event",
"id": "5e965",
"cue": "SF1.12",
"title": "Denmark",
"note": "SF1.12",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 57600000,
"timeEnd": 58800000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "The Show",
"artist": "Reddi"
}
},
"bab4a": {
"type": "event",
"id": "bab4a",
"cue": "SF1.13",
"title": "Austria",
"note": "SF1.13",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 59100000,
"timeEnd": 60300000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Halo",
"artist": "LUM!X & Pia Maria"
}
},
"d3eb1": {
"type": "event",
"id": "d3eb1",
"cue": "SF1.14",
"title": "Greece",
"note": "SF1.14",
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"linkStart": null,
"timeStrategy": "lock-end",
"timeStart": 60600000,
"timeEnd": 61800000,
"duration": 1200000,
"isPublic": true,
"skip": false,
"colour": "",
"currentBlock": null,
"revision": 0,
"delay": 0,
"dayOffset": 0,
"gap": 300000,
"timeWarning": 500000,
"timeDanger": 100000,
"custom": {
"song": "Die Together",
"artist": "Amanda Tenfjord"
}
}
},
"revision": 0
}
},
"project": {
"title": "Eurovision Song Contest",
"description": "Turin 2022",
"publicUrl": "www.getontime.no",
"publicInfo": "Rehearsal Schedule - Turin 2022",
"backstageUrl": "www.github.com/cpvalente/ontime",
"backstageInfo": "Rehearsal Schedule - Turin 2022\nAll performers to wear full costumes for 1st rehearsal",
"projectLogo": null
},
"settings": {
"app": "ontime",
"version": "-",
"serverPort": 4001,
"editorKey": null,
"operatorKey": null,
"timeFormat": "24",
"language": "en"
},
"viewSettings": {
"dangerColor": "#ED3333",
"endMessage": "",
"freezeEnd": false,
"normalColor": "#ffffffcc",
"overrideStyles": false,
"warningColor": "#FFAB33"
},
"customFields": {
"song": {
"label": "Song",
"type": "string",
"colour": "#339E4E"
},
"artist": {
"label": "Artist",
"type": "string",
"colour": "#3E75E8"
}
},
"urlPresets": [
{
"enabled": true,
"alias": "test",
"pathAndParams": "lower?bg=ff2&text=f00&size=0.6&transition=5"
}
],
"automation": {
"enabledAutomations": false,
"enabledOscIn": true,
"oscPortIn": 8888,
"triggers": [],
"automations": {}
}
}
-458
View File
@@ -1,458 +0,0 @@
{
"rundown": [
{
"id": "32d31",
"type": "event",
"title": "Albania",
"timeStart": 36000000,
"timeEnd": 37200000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.01",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.01",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Sekret",
"artist": "Ronela Hajati"
}
},
{
"id": "21cd2",
"type": "event",
"title": "Latvia",
"timeStart": 37500000,
"timeEnd": 38700000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.02",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.02",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Eat Your Salad",
"artist": "Citi Zeni"
}
},
{
"id": "0b371",
"type": "event",
"title": "Lithuania",
"timeStart": 39000000,
"timeEnd": 40200000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.03",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.03",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Sentimentai",
"artist": "Monika Liu"
}
},
{
"id": "3cd28",
"type": "event",
"title": "Switzerland",
"timeStart": 40500000,
"timeEnd": 41700000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.04",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.04",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Boys Do Cry",
"artist": "Marius Bear"
}
},
{
"id": "e457f",
"type": "event",
"title": "Slovenia",
"timeStart": 42000000,
"timeEnd": 43200000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.05",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.05",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Disko",
"artist": "LPS"
}
},
{
"title": "Lunch break",
"type": "block",
"id": "01e85"
},
{
"id": "1c420",
"type": "event",
"title": "Ukraine",
"timeStart": 47100000,
"timeEnd": 48300000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.06",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.06",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Stefania",
"artist": "Kalush Orchestra"
}
},
{
"id": "b7737",
"type": "event",
"title": "Bulgaria",
"timeStart": 48600000,
"timeEnd": 49800000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.07",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.07",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Intention",
"artist": "Intelligent Music Project"
}
},
{
"id": "d3a80",
"type": "event",
"title": "Netherlands",
"timeStart": 50100000,
"timeEnd": 51300000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.08",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.08",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "De Diepte",
"artist": "S10"
}
},
{
"id": "8276c",
"type": "event",
"title": "Moldova",
"timeStart": 51600000,
"timeEnd": 52800000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.09",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.09",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Trenuletul",
"artist": "Zdob si Zdub"
}
},
{
"id": "2340b",
"type": "event",
"title": "Portugal",
"timeStart": 53100000,
"timeEnd": 54300000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.10",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.10",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Saudade Saudade",
"artist": "Maro"
}
},
{
"title": "Afternoon break",
"type": "block",
"id": "cb90b"
},
{
"id": "503c4",
"type": "event",
"title": "Croatia",
"timeStart": 56100000,
"timeEnd": 57300000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.11",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.11",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Guilty Pleasure",
"artist": "Mia Dimsic"
}
},
{
"id": "5e965",
"type": "event",
"title": "Denmark",
"timeStart": 57600000,
"timeEnd": 58800000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.12",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.12",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "The Show",
"artist": "Reddi"
}
},
{
"id": "bab4a",
"type": "event",
"title": "Austria",
"timeStart": 59100000,
"timeEnd": 60300000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.13",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.13",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Halo",
"artist": "LUM!X & Pia Maria"
}
},
{
"id": "d3eb1",
"type": "event",
"title": "Greece",
"timeStart": 60600000,
"timeEnd": 61800000,
"duration": 1200000,
"timeStrategy": "lock-duration",
"linkStart": null,
"endAction": "none",
"timerType": "count-down",
"countToEnd": false,
"isPublic": true,
"skip": false,
"note": "SF1.14",
"colour": "",
"delay": 0,
"dayOffset": 0,
"gap": 0,
"cue": "SF1.14",
"revision": 0,
"timeWarning": 120000,
"timeDanger": 60000,
"custom": {
"song": "Die Together",
"artist": "Amanda Tenfjord"
}
}
],
"project": {
"title": "Eurovision Song Contest",
"description": "Turin 2022",
"publicUrl": "www.getontime.no",
"publicInfo": "Rehearsal Schedule - Turin 2022",
"backstageUrl": "www.github.com/cpvalente/ontime",
"backstageInfo": "Rehearsal Schedule - Turin 2022\nAll performers to wear full costumes for 1st rehearsal",
"projectLogo": null
},
"settings": {
"app": "ontime",
"version": "3.10.2",
"serverPort": 4001,
"editorKey": null,
"operatorKey": null,
"timeFormat": "24",
"language": "en"
},
"viewSettings": {
"overrideStyles": false,
"normalColor": "#ffffffcc",
"warningColor": "#FFAB33",
"dangerColor": "#ED3333",
"endMessage": "",
"freezeEnd": false
},
"urlPresets": [
{
"enabled": true,
"alias": "test",
"pathAndParams": "lower?bg=ff2&text=f00&size=0.6&transition=5"
}
],
"automation": {
"enabledAutomations": false,
"enabledOscIn": true,
"oscPortIn": 8888,
"triggers": [],
"automations": {}
},
"customFields": {
"song": {
"type": "string",
"colour": "",
"label": "song"
},
"artist": {
"type": "string",
"colour": "",
"label": "artist"
}
}
}