fixed some minor stuff

This commit is contained in:
Hellow 2023-06-15 12:46:01 +02:00
parent 1324802db7
commit 6197345023
2 changed files with 6 additions and 3 deletions

View File

@ -45,9 +45,9 @@ def correct_codec(target: Target, bitrate_kb: int = BITRATE, audio_format: str =
# run the ffmpeg command with a progressbar # run the ffmpeg command with a progressbar
ff = FfmpegProgress(ffmpeg_command) ff = FfmpegProgress(ffmpeg_command)
with tqdm(total=100, position=1, desc="ffmpeg") as pbar: with tqdm(total=100, desc="ffmpeg") as pbar:
for progress in ff.run_command_with_progress(): for progress in ff.run_command_with_progress():
pbar.update(progress - pbar.n) pbar.update(int(progress)-pbar.n)
LOGGER.debug(ff.stderr) LOGGER.debug(ff.stderr)

View File

@ -58,7 +58,7 @@ class Config:
self._name_section_map[name] = element self._name_section_map[name] = element
self._length += 1 self._length += 1
def set_name_to_value(self, name: str, value: str): def set_name_to_value(self, name: str, value: str, silent: bool = True):
""" """
:raises SettingValueError, SettingNotFound: :raises SettingValueError, SettingNotFound:
:param name: :param name:
@ -66,6 +66,9 @@ class Config:
:return: :return:
""" """
if name not in self._name_section_map: if name not in self._name_section_map:
if silent:
LOGGER.warning(f"The setting \"{name}\" is either deprecated, or doesn't exist.")
return
raise SettingNotFound(setting_name=name) raise SettingNotFound(setting_name=name)
LOGGER.debug(f"setting: {name} value: {value}") LOGGER.debug(f"setting: {name} value: {value}")