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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user