From 47584821f90e2884edb753ec10da3f8a68b055d7 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Tue, 12 Nov 2019 02:40:01 -0800 Subject: [PATCH] thrimbletrimmer: Handle null trim in submit mainly for save draft --- thrimbletrimmer/scripts/IO.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/thrimbletrimmer/scripts/IO.js b/thrimbletrimmer/scripts/IO.js index 65ec5bd..0040031 100644 --- a/thrimbletrimmer/scripts/IO.js +++ b/thrimbletrimmer/scripts/IO.js @@ -232,9 +232,14 @@ thrimbletrimmerSubmit = function(state) { document.getElementById('SubmitButton').disabled = true; var discontinuities = mapDiscontinuities(); + var start = getRealTimeForPlayerTime(discontinuities, player.trimmingControls().options.startTrim); + if (start) {start = start.replace('Z','');} + var end = getRealTimeForPlayerTime(discontinuities, player.trimmingControls().options.endTrim); + if (end) {end = end.replace('Z','');} + var wubData = { - video_start:getRealTimeForPlayerTime(discontinuities, player.trimmingControls().options.startTrim).replace('Z',''), - video_end:getRealTimeForPlayerTime(discontinuities, player.trimmingControls().options.endTrim).replace('Z',''), + video_start:start, + video_end:end, video_title:document.getElementById("VideoTitle").value, video_description:document.getElementById("VideoDescription").value, allow_holes:document.getElementById('AllowHoles').checked,