From 824ae6a20f5fe01d5b3866e0d59bbb9f42223e57 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Mon, 16 Dec 2024 16:40:21 +0100 Subject: 🛠️ Fixed wrong symlink creation. Hot fixed extension detection of `tidalapi`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/download.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tidal_dl_ng') diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index 6679371..ceec5c5 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -468,14 +468,20 @@ class Download: # Move item and symlink it if path_media_dst != path_media_src: if self.skip_existing: - skip_file: bool = check_file_exists(path_media_dst, extension_ignore=True) + skip_file: bool = check_file_exists(path_media_dst, extension_ignore=False) + skip_symlink: bool = path_media_src.is_symlink() else: skip_file: bool = False + skip_symlink: bool = False if not skip_file: + self.fn_logger.debug(f"Move: {path_media_src} -> {path_media_dst}") shutil.move(path_media_src, path_media_dst) - os.symlink(path_media_dst, path_media_src) + if not skip_symlink: + self.fn_logger.debug(f"Symlink: {path_media_src} -> {path_media_dst}") + path_media_src.unlink(missing_ok=True) + path_media_src.symlink_to(path_media_dst) return path_media_dst @@ -712,6 +718,8 @@ class Download: path_playlist = dir_scoped / (PLAYLIST_PREFIX + name_list + PLAYLIST_EXTENSION) path_playlist = pathlib.Path(path_file_sanitize(path_playlist, adapt=True)) + self.fn_logger.debug(f"Playlist: Creating {path_playlist}") + # Get all tracks in the directory path_tracks: [pathlib.Path] = [] -- cgit v1.3.1