summaryrefslogtreecommitdiff
path: root/tidal_dl_ng
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-12-16 16:40:21 +0100
committerRobert Honz <exislow+github@gmail.com>2024-12-16 16:40:21 +0100
commit824ae6a20f5fe01d5b3866e0d59bbb9f42223e57 (patch)
treedd90e7a6b1995e7f373525de4b6fdcca559ae1e5 /tidal_dl_ng
parentf1a069f21102dc872275c4aec90d57b95702637a (diff)
downloadtidal-dl-ng-824ae6a20f5fe01d5b3866e0d59bbb9f42223e57.tar.gz
🛠️ Fixed wrong symlink creation. Hot fixed extension detection of `tidalapi`.
Diffstat (limited to 'tidal_dl_ng')
-rw-r--r--tidal_dl_ng/download.py12
1 files changed, 10 insertions, 2 deletions
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] = []