From 90421090e9512da1029540e6ead8d3124aa18c0c Mon Sep 17 00:00:00 2001 From: Peter Belbin Date: Tue, 1 Nov 2022 21:17:30 -0500 Subject: [PATCH 1/2] Provide 'steps' value to template definition Without having the 'steps' value available in the template, there's nothing to copy when building the rundown, hence the 'continue' button does not function properly. --- routes/routes-application.js | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/routes-application.js b/routes/routes-application.js index 3979e869..b09971c0 100644 --- a/routes/routes-application.js +++ b/routes/routes-application.js @@ -624,6 +624,7 @@ router.post('/show/:foldername/config', spxAuth.CheckLogin, async (req, res) => if (!SPXGCTemplateDefinition.out) {SPXGCTemplateDefinition.out = "manual"}; if (!SPXGCTemplateDefinition.dataformat) {SPXGCTemplateDefinition.dataformat = "xml"}; if (!SPXGCTemplateDefinition.uicolor) {SPXGCTemplateDefinition.uicolor = "0"}; + if (!SPXGCTemplateDefinition.steps) {SPXGCTemplateDefinition.steps = "1"}; // v.1.0.15 add imported timestamp SPXGCTemplateDefinition.imported = String(Date.now()); // epoch. This COULD be used to compare template versions in profile/rundown. From aca7e1d65074dde6cd842f597c358dac4f76b8f4 Mon Sep 17 00:00:00 2001 From: pbelbin Date: Wed, 2 Nov 2022 23:18:17 -0500 Subject: [PATCH 2/2] Additional changes needed to allow 'steps' to be preserved Particularly when editing the template. Previously, would discard the steps value --- routes/routes-api.js | 7 +++++-- routes/routes-application.js | 15 +++++++++++++-- static/js/spx_fileBrowser.js | 3 +++ views/view-showconfig.handlebars | 3 ++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/routes/routes-api.js b/routes/routes-api.js index 420e1b9f..61cdb371 100644 --- a/routes/routes-api.js +++ b/routes/routes-api.js @@ -246,7 +246,8 @@ router.post('/exportCSVfile', async (req, res) => { item_out, item_uicolor, item_dataformat, - item_relpath + item_relpath, + item_steps rundownData.templates.forEach((item,index) => { // console.log('Iterating template index ' + index); @@ -263,6 +264,7 @@ router.post('/exportCSVfile', async (req, res) => { item_uicolor = item.uicolor || '0'; item_dataformat = item.dataformat || 'json'; item_relpath = item.relpath || ''; + item_steps = item.steps || '1'; CSVdata = '\r\n# SPX Rundown item CSV export. (More info: https://spxgc.tawk.help/article/help-csv-files)\r\n\r\n' CSVdata += '# description #;' + item_description + '\r\n' @@ -274,6 +276,7 @@ router.post('/exportCSVfile', async (req, res) => { CSVdata += '# uicolor #;' + item_uicolor + '\r\n' CSVdata += '# dataformat #;' + item_dataformat + '\r\n' CSVdata += '# relpath #;' + item_relpath + '\r\n' + CSVdata += '# steps #;' + item_steps + '\r\n' CSVdata += '# onair #;false\r\n' CSVdata += '# project #;' + showFolder + '\r\n' CSVdata += '# rundown #;' + datafile + '\r\n' @@ -374,4 +377,4 @@ async function GetDataFiles() { } // GetDataFiles ended -module.exports = router; \ No newline at end of file +module.exports = router; diff --git a/routes/routes-application.js b/routes/routes-application.js index 3979e869..1d77ad1e 100644 --- a/routes/routes-application.js +++ b/routes/routes-application.js @@ -624,6 +624,7 @@ router.post('/show/:foldername/config', spxAuth.CheckLogin, async (req, res) => if (!SPXGCTemplateDefinition.out) {SPXGCTemplateDefinition.out = "manual"}; if (!SPXGCTemplateDefinition.dataformat) {SPXGCTemplateDefinition.dataformat = "xml"}; if (!SPXGCTemplateDefinition.uicolor) {SPXGCTemplateDefinition.uicolor = "0"}; + if (!SPXGCTemplateDefinition.steps) {SPXGCTemplateDefinition.steps = "1"}; // v.1.0.15 add imported timestamp SPXGCTemplateDefinition.imported = String(Date.now()); // epoch. This COULD be used to compare template versions in profile/rundown. @@ -1003,6 +1004,7 @@ router.post('/gc/:foldername/:filename/', spxAuth.CheckLogin, async (req, res) = var t_relpath var t_project var t_rundown + var t_steps let curLineItems = [] @@ -1069,6 +1071,10 @@ router.post('/gc/:foldername/:filename/', spxAuth.CheckLogin, async (req, res) = t_rundown = curLineItems[1].trim(); break; + case '# steps #': + t_steps = curLineItems[1].trim(); + break; + case '# FieldUUIDs #': // this line carries f-field ids (f0, f1, etc) @@ -1130,6 +1136,8 @@ router.post('/gc/:foldername/:filename/', spxAuth.CheckLogin, async (req, res) = templateData.onair = t_onair templateData.dataformat = t_dataformat templateData.relpath = t_relpath + templateData.steps = t_steps + // Append warning templateData.DataFields.push({ @@ -1346,6 +1354,7 @@ router.post('/gc/playout', spxAuth.CheckLogin, async (req, res) => { dataOut.playchannel= ItemData.playchannel; dataOut.playlayer = ItemData.playlayer; dataOut.webplayout = ItemData.webplayout; + dataOut.steps = ItemData.steps; dataOut.dataformat = ItemData.dataformat || 'xml'; // TODO: Move this to all template's definition objet. Values 'xml' or 'json', defaulting to 'xml' ItemData.DataFields.forEach(item => { // We pass data as custom JSON format and the format is changed @@ -1441,14 +1450,16 @@ router.post('/gc/playout', spxAuth.CheckLogin, async (req, res) => { let thisChannel = item.playchannel || '1'; let thisLayer = item.playlayer || '1'; let thisWeb = item.webplayout || '-'; - let thisOutput = thisServer.trim() + thisChannel.trim() + thisLayer.trim() + thisWeb.trim() + thisOnair.trim(); + let thisSteps = item.steps || '1'; + let thisOutput = thisServer.trim() + thisChannel.trim() + thisLayer.trim() + thisWeb.trim() + thisOnair.trim() + thisSteps.trim(); let dataOnair = 'true' // because we are in play; let dataServer = dataOut.playserver || '-'; let dataChannel = dataOut.playchannel || '1'; let dataLayer = dataOut.playlayer || '1'; let dataWeb = dataOut.webplayout || '-'; - let dataOutput = dataServer.trim() + dataChannel.trim() + dataLayer.trim() + dataWeb.trim() + dataOnair.trim(); + let dataSteps = dataOut.steps || '1'; + let dataOutput = dataServer.trim() + dataChannel.trim() + dataLayer.trim() + dataWeb.trim() + dataOnair.trim() + dataSteps.trim(); if (index!=templateIndex && thisOutput==dataOutput){ RundownData.templates[index].onair='false'; diff --git a/static/js/spx_fileBrowser.js b/static/js/spx_fileBrowser.js index ddfae08c..0fd76e71 100644 --- a/static/js/spx_fileBrowser.js +++ b/static/js/spx_fileBrowser.js @@ -259,6 +259,7 @@ function playItem() { spxPlayoutData.playchannel = extensionConfig.template.playchannel || 1; spxPlayoutData.playlayer = extensionConfig.template.playlayer || 10; spxPlayoutData.webplayout = extensionConfig.template.webplayout || 10; + spxPlayoutData.steps = extensionConfig.template.steps || 1; spxPlayoutData.relpathCCG = spxPlayoutData.relpath.split('.htm')[0]; spxPlayoutData.fields = fFields spxPlayoutData.command = 'play'; @@ -292,6 +293,7 @@ function stopItem() { spxPlayoutData.playchannel = extensionConfig.template.playchannel || 1; spxPlayoutData.playlayer = extensionConfig.template.playlayer || 10; spxPlayoutData.webplayout = extensionConfig.template.webplayout || 10; + spxPlayoutData.steps = extensionConfig.template.steps || 1; spxPlayoutData.relpathCCG = spxPlayoutData.relpath.split('.htm')[0]; spxPlayoutData.command = 'stop'; if (Array.isArray(spxPlayoutData.playserver)) { @@ -333,6 +335,7 @@ window.addEventListener('load', async () => { "playchannel": 1, "playlayer": 2, "webplayout": 2, + "steps": 1, "imageLayerAnimationStyle": { "inAnimation": "fade", "easing": "linear" diff --git a/views/view-showconfig.handlebars b/views/view-showconfig.handlebars index 714f721f..6e471392 100644 --- a/views/view-showconfig.handlebars +++ b/views/view-showconfig.handlebars @@ -83,6 +83,7 @@
+ @@ -498,4 +499,4 @@ } - \ No newline at end of file +