Fix: cutting long file names to avoid errors when saving

This commit is contained in:
napuh committed 2022-07-13 19:47:33 +02:00
1 parent 900816535b
commit 1bd39db6f2
1 file changed
+1 -1
+1 -1
View File
@@ -29,11 +29,11 @@ def name_normalize(name: str) -> str:
name = re.sub(r"(\d+)\s?\/\s?(\d+)", r"\1 of \2", name)
name = re.sub(r"(\w+)\s?\/\s?(\w+)", r"\1 or \2", name)
name = re.sub(r"\/", r"", name)
name[:70]
lang = settings.config["reddit"]["thread"]["post_lang"]
if lang:
import translators as ts
print_substep("Translating filename...")
translated_name = ts.google(name, to_language=lang)
return translated_name