summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/download.py
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2025-08-13 08:17:11 +0200
committerRobert Honz <exislow+github@gmail.com>2025-08-13 08:17:11 +0200
commit8dd75897e3c138826893cb99822dbeebc8efc54c (patch)
treed72769d332592460899441abd32c8644894d657c /tidal_dl_ng/download.py
parent0d8bc88f96e4e60b258f3b88b19f9114c2ef99c6 (diff)
downloadtidal-dl-ng-8dd75897e3c138826893cb99822dbeebc8efc54c.tar.gz
refactor(constants): streamline enums and enhance type annotations
This commit refactors the codebase to improve readability and maintainability by updating enums and type annotations: - โœจ **Replaced `StrEnum` attributes**: Removed explicit type declarations for enum values to simplify the code. - ๐Ÿ› ๏ธ **Introduced `AudioExtensionsValid` enum**: Added a new enum for valid audio file extensions. - ๐Ÿ”„ **Enhanced type annotations**: Updated `FAVORITES` dictionary to include specific type hints for clarity. - ๐Ÿงน **Updated references**: Replaced outdated `AudioExtensions` usage with the new `AudioExtensionsValid`. These changes improve code clarity, enforce stricter typing, and enhance extensibility.
Diffstat (limited to 'tidal_dl_ng/download.py')
-rw-r--r--tidal_dl_ng/download.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py
index cf95df8..56c3099 100644
--- a/tidal_dl_ng/download.py
+++ b/tidal_dl_ng/download.py
@@ -38,6 +38,7 @@ from tidal_dl_ng.constants import (
PLAYLIST_EXTENSION,
PLAYLIST_PREFIX,
REQUESTS_TIMEOUT_SEC,
+ AudioExtensionsValid,
CoverDimensions,
MediaType,
QualityVideo,
@@ -1496,7 +1497,7 @@ class Download:
# Get all tracks in the directory
path_tracks: list[pathlib.Path] = []
- for extension_audio in AudioExtensions:
+ for extension_audio in AudioExtensionsValid:
path_tracks = path_tracks + list(dir_scoped.glob(f"*{extension_audio!s}"))
# Sort alphabetically, e.g. if items are prefixed with numbers