From ec8350c19999ec28a4d6154166b5b06185f3a86c Mon Sep 17 00:00:00 2001 From: vladaad <59199127+vladaad@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:51:32 +0100 Subject: [PATCH] automatically change target filesize when uploading --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 1f98c7f..774e79a 100644 --- a/main.go +++ b/main.go @@ -66,6 +66,7 @@ func init() { forceContaine := flag.String("f", "", "Uses a specific container") // don't mind the cut off letters thanks mixAudio := flag.Bool("mixaudio", false, "Mix together all audio tracks") normAudio := flag.Bool("normaudio", false, "Normalize the audio volume") + upload := flag.Bool("upload", false, "Upload the video to the service defined in settings.json") flag.Parse() if len(flag.Args()) == 0 { @@ -88,6 +89,9 @@ func init() { // Load defaults if *targetSizeMB == float64(-1) { + if *upload { // This is only set when the flag is used to ensure that TargetSizeMB in settings can still be used to compensate for overhead in some configs + *targetSizeMB = settings.General.UploadMaxMB + } *targetSizeMB = settings.General.TargetSizeMB } targetSize = int(*targetSizeMB * 8388608) // 1024*1024*8 - in bits