From c53c89fe259052782d14cdb17008ba3daef8b661 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Fri, 2 Sep 2022 16:08:42 +1000 Subject: [PATCH] thrimbletrimmer: Add advanced submission option for "public" videos Note that the default is true, so we only expand the advanced pane if it's false. False corresponds to uploading a video as "unlisted". Also mark it as modifyable. --- thrimbletrimmer/edit.html | 5 +++++ thrimbletrimmer/scripts/edit.js | 8 ++++++++ thrimshim/thrimshim/main.py | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/thrimbletrimmer/edit.html b/thrimbletrimmer/edit.html index d2b8cc5..1f5fc38 100644 --- a/thrimbletrimmer/edit.html +++ b/thrimbletrimmer/edit.html @@ -205,6 +205,11 @@ +
+ + +
+
diff --git a/thrimbletrimmer/scripts/edit.js b/thrimbletrimmer/scripts/edit.js index e596a1c..6a7fc23 100644 --- a/thrimbletrimmer/scripts/edit.js +++ b/thrimbletrimmer/scripts/edit.js @@ -385,6 +385,12 @@ async function initializeVideoInfo() { modifiedAdvancedOptions = true; } + const publicCheckbox = document.getElementById("advanced-submission-option-public"); + publicCheckbox.checked = videoInfo.public; + if (!videoInfo.public) { + modifiedAdvancedOptions = true; + } + const uploadLocationSelection = document.getElementById( "advanced-submission-option-upload-location" ); @@ -782,6 +788,7 @@ async function sendVideoData(newState, overrideChanges) { const videoTitle = document.getElementById("video-info-title").value; const videoTags = document.getElementById("video-info-tags").value.split(","); const allowHoles = document.getElementById("advanced-submission-option-allow-holes").checked; + const isPublic = document.getElementById("advanced-submission-option-public").checked; const uploadLocation = document.getElementById( "advanced-submission-option-upload-location" ).value; @@ -798,6 +805,7 @@ async function sendVideoData(newState, overrideChanges) { video_tags: videoTags, allow_holes: allowHoles, upload_location: uploadLocation, + public: isPublic, video_channel: globalStreamName, video_quality: videoInfo.video_quality, uploader_whitelist: uploaderAllowlist, diff --git a/thrimshim/thrimshim/main.py b/thrimshim/thrimshim/main.py index f06f8a8..dd80999 100644 --- a/thrimshim/thrimshim/main.py +++ b/thrimshim/thrimshim/main.py @@ -206,7 +206,7 @@ def update_row(ident, editor=None): 'video_channel', 'video_quality', 'video_title', 'video_description', 'video_tags', ] - edit_columns = non_null_columns + ['allow_holes', 'uploader_whitelist'] + edit_columns = non_null_columns + ['allow_holes', 'uploader_whitelist', 'public'] sheet_columns = [ 'sheet_name', 'event_start', 'event_end', 'category', 'description', 'notes', 'tags', @@ -214,7 +214,7 @@ def update_row(ident, editor=None): # These columns may be modified when a video is in state 'DONE', # and are a subset of edit_columns. modifiable_columns = [ - 'video_title', 'video_description', 'video_tags', + 'video_title', 'video_description', 'video_tags', 'public' ] assert set(modifiable_columns) - set(edit_columns) == set()