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.
pull/300/head
Mike Lang 2 years ago committed by Mike Lang
parent 46468409cb
commit bd948235fb

@ -205,6 +205,11 @@
<input type="checkbox" id="advanced-submission-option-allow-holes" />
</div>
<div>
<label for="advanced-submission-option-public">Make public (not unlisted)</label>
<input type="checkbox" id="advanced-submission-option-public" />
</div>
<div>
<label for="advanced-submission-option-upload-location">Upload location:</label>
<select id="advanced-submission-option-upload-location"></select>

@ -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,

@ -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()

Loading…
Cancel
Save