fix: lambda

This commit is contained in:
2026-08-07 00:13:00 -03:00
parent b1c7a42172
commit 3553426a72
2 changed files with 10 additions and 8 deletions
+8 -6
View File
@@ -60,11 +60,11 @@ class GenericTTSBackend:
".ogg": "ogg",
}
_INPUT_FLAG_MAP = lambda x: [
"--input-dir", x] if x else ["--input-file", x]
_INPUT_FLAG_MAP = lambda self, is_dir, path: [
"--input-dir", path] if is_dir else ["--input-file", path]
_OUTPUT_FLAG_MAP = lambda x: [
"--output-dir", x] if x else ["--output-file", x]
_OUTPUT_FLAG_MAP = lambda self, is_dir, path: [
"--output-dir", path] if is_dir else ["--output-file", path]
def __init__(self,**kwargs):
for k,v in kwargs.items():
@@ -79,11 +79,13 @@ class GenericTTSBackend:
def gen_input_flag(self, input_path: Path) -> str:
return self._INPUT_FLAG_MAP(self._normalize_path(input_path).is_dir())
return self._INPUT_FLAG_MAP(
self._normalize_path(input_path).is_dir(), input_path)
def gen_output_flag(self, output_path: Path) -> str:
return self._OUTPUT_FLAG_MAP(self._normalize_path(output_path).is_dir())
return self._OUTPUT_FLAG_MAP(
self._normalize_path(output_path).is_dir(), output_path)
def _build_command(self, input_source: PathLike, output_dest: PathLike) -> list[str]: