Added video_length in config

pull/1072/head
Josh Greenwood 3 years ago
parent b463d2223b
commit 4e70ad5f1c

@ -13,7 +13,7 @@ from utils.console import print_step, print_substep
from utils.voice import sanitize_text from utils.voice import sanitize_text
from utils import settings from utils import settings
DEFAULT_MAX_LENGTH: int = 50 # video length variable
class TTSEngine: class TTSEngine:
@ -24,7 +24,6 @@ class TTSEngine:
tts_module : The TTS module. Your module should handle the TTS itself and saving to the given path under the run method. tts_module : The TTS module. Your module should handle the TTS itself and saving to the given path under the run method.
reddit_object : The reddit object that contains the posts to read. reddit_object : The reddit object that contains the posts to read.
path (Optional) : The unix style path to save the mp3 files to. This must not have leading or trailing slashes. path (Optional) : The unix style path to save the mp3 files to. This must not have leading or trailing slashes.
max_length (Optional) : The maximum length of the mp3 files in total.
Notes: Notes:
tts_module must take the arguments text and filepath. tts_module must take the arguments text and filepath.
@ -35,13 +34,12 @@ class TTSEngine:
tts_module, tts_module,
reddit_object: dict, reddit_object: dict,
path: str = "assets/temp/mp3", path: str = "assets/temp/mp3",
max_length: int = DEFAULT_MAX_LENGTH,
last_clip_length: int = 0, last_clip_length: int = 0,
): ):
self.tts_module = tts_module() self.tts_module = tts_module()
self.reddit_object = reddit_object self.reddit_object = reddit_object
self.path = path self.path = path
self.max_length = max_length self.max_length = settings.config["settings"]["video_length"]
self.length = 0 self.length = 0
self.last_clip_length = last_clip_length self.last_clip_length = last_clip_length

@ -21,6 +21,7 @@ min_comments = { default = 20, optional = false, nmin = 15, type = "int", explan
allow_nsfw = { optional = false, type = "bool", default = false, example = false, options = [true, allow_nsfw = { optional = false, type = "bool", default = false, example = false, options = [true,
false, false,
], explanation = "Whether to allow NSFW content, True or False" } ], explanation = "Whether to allow NSFW content, True or False" }
video_length = { default = 50, optional = false, nmin = 20, nmax = 3600, type = "int", explanation = "The minimum length of a video in seconds. default is 50", example = 25, oob_error = "the length of the video should be between 20 and 3600 seconds" }
theme = { optional = false, default = "dark", example = "light", options = ["dark", theme = { optional = false, default = "dark", example = "light", options = ["dark",
"light", "light",
], explanation = "sets the Reddit theme, either LIGHT or DARK" } ], explanation = "sets the Reddit theme, either LIGHT or DARK" }

Loading…
Cancel
Save