From 5fd59fc5b42d31559120dc28bfef4e5002fb509e Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 11 Nov 2023 13:22:12 -0600 Subject: [PATCH] Change commandline flag to allow disabling video, since it is enabled by default --- src/config/commandline.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/config/commandline.rs b/src/config/commandline.rs index fef72a8..13d25d1 100644 --- a/src/config/commandline.rs +++ b/src/config/commandline.rs @@ -81,7 +81,7 @@ impl Args { media_animation_quality_apng, media_animation_quality_avif, media_animation_quality_webp, - media_video_enable, + media_video_disable, media_video_allow_audio, media_video_max_width, media_video_max_height, @@ -172,7 +172,7 @@ impl Args { }; let video = Video { - enable: media_video_enable, + enable: !media_video_disable, allow_audio: media_video_allow_audio, max_file_size: media_video_max_file_size, max_width: media_video_max_width, @@ -741,10 +741,14 @@ impl AnimationQuality { } } +fn is_set(input: &bool) -> bool { + *input +} + #[derive(Debug, Default, serde::Serialize)] #[serde(rename_all = "snake_case")] struct Video { - #[serde(skip_serializing_if = "std::ops::Not::not")] + #[serde(skip_serializing_if = "is_set")] enable: bool, #[serde(skip_serializing_if = "std::ops::Not::not")] allow_audio: bool, @@ -1025,9 +1029,9 @@ struct Run { #[arg(long)] media_animation_quality_webp: Option, - /// Whether to enable video uploads + /// Whether to disable video uploads (enabled by default) #[arg(long)] - media_video_enable: bool, + media_video_disable: bool, /// Whether to enable audio in video uploads #[arg(long)] media_video_allow_audio: bool,