summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/helper/path.py
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2025-08-12 10:18:20 +0200
committerRobert Honz <exislow+github@gmail.com>2025-08-12 10:18:20 +0200
commita0a6a8d15b32bf4f95dda7c35934f8aaad8478a5 (patch)
treec34e3cc0cd9a1616e6456973ac04c251e6bf69f7 /tidal_dl_ng/helper/path.py
parentc825cc2587a20994c53b9c61cd3ee769759eae25 (diff)
downloadtidal-dl-ng-a0a6a8d15b32bf4f95dda7c35934f8aaad8478a5.tar.gz
refactor(helper): improve ID format handling logic
Refactors the ID formatting logic to extend support for `video_id` and improve clarity. - ✨ **Feature:** Adds support for `video_id` in ID formatting logic. - ♻️ **Refactor:** Updates conditional checks for better readability. - 🔧 **Metadata:** Updates `poetry.lock` content hash. These changes enhance functionality and maintainability by accommodating additional media types.
Diffstat (limited to 'tidal_dl_ng/helper/path.py')
-rw-r--r--tidal_dl_ng/helper/path.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py
index 12ffdce..0f7de31 100644
--- a/tidal_dl_ng/helper/path.py
+++ b/tidal_dl_ng/helper/path.py
@@ -279,8 +279,10 @@ def _format_ids(
str | None: The formatted ID or None if the format string is not ID-related.
"""
# Handle track and playlist IDs
- if (name == "track_id" and isinstance(media, Track | Video)) or (
- name == "playlist_id" and isinstance(media, Playlist)
+ if (
+ (name == "track_id" and isinstance(media, Track))
+ or (name == "playlist_id" and isinstance(media, Playlist))
+ or (name == "video_id" and isinstance(media, Video))
):
return str(media.id)
# Handle album IDs