diff --git a/zotify/app.py b/zotify/app.py index 3ef8e2d..4c25cb1 100644 --- a/zotify/app.py +++ b/zotify/app.py @@ -267,9 +267,10 @@ class App: track.metadata.extend(playable.metadata) try: output = track.create_output( + self.__config.audio_format.value.ext, playable.library, playable.output_template, - self.__config.replace_existing, + self.__config.replace_existing ) except FileExistsError: Logger.log( diff --git a/zotify/playable.py b/zotify/playable.py index 083ba3d..aa7fa7c 100644 --- a/zotify/playable.py +++ b/zotify/playable.py @@ -65,6 +65,7 @@ class Playable: def create_output( self, + ext: str, library: Path | str = Path("./"), output: str = "{title}", replace: bool = False, @@ -86,7 +87,7 @@ class Playable: "{" + meta.name + "}", fix_filename(meta.string) ) file_path = library.joinpath(output).expanduser() - if file_path.exists() and not replace: + if file_path.with_suffix("." + ext).exists() and not replace: raise FileExistsError("File already downloaded") else: file_path.parent.mkdir(parents=True, exist_ok=True)