1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

formatname: fix tilde so it actually works

This commit is contained in:
Johan Andersson 2021-09-10 20:34:07 +02:00
parent 4527edd962
commit 08a85a97e9

View File

@ -143,14 +143,14 @@ def formatname(output, config):
# Add subfolder with name movies # Add subfolder with name movies
name = pathlib.Path("movies") / name.name name = pathlib.Path("movies") / name.name
if config.get("output") and pathlib.Path(config.get("output")).expanduser().is_dir(): if config.get("output") and pathlib.Path(config.get("output")).expanduser().is_dir():
name = pathlib.Path(config.get("output")) / name.name name = pathlib.Path(config.get("output")).expanduser() / name.name
elif config.get("path") and pathlib.Path(config.get("path")).expanduser().is_dir(): elif config.get("path") and pathlib.Path(config.get("path")).expanduser().is_dir():
name = pathlib.Path(config.get("path")) / name.name name = pathlib.Path(config.get("path")).expanduser() / name.name
elif config.get("output"): elif config.get("output"):
if output["ext"]: if output["ext"]:
name = pathlib.Path(f"{config.get('output')}.{output['ext']}") name = pathlib.Path(f"{config.get('output')}.{output['ext']}").expanduser()
else: else:
name = pathlib.Path(config.get("output")) name = pathlib.Path(config.get("output")).expanduser()
return name return name