diff options
| author | Warry <FunWarry@users.noreply.github.com> | 2025-12-29 20:05:34 +0100 |
|---|---|---|
| committer | Warry <FunWarry@users.noreply.github.com> | 2025-12-29 20:05:34 +0100 |
| commit | f413240b51f574c01144e6ae672b24c412a949e1 (patch) | |
| tree | ee26239282d17057a5eabd7a7b130c248b380f9d /tidal_dl_ng/ui | |
| parent | 296c6c7d6b319b38958b2aacb9904f18f6f46fd1 (diff) | |
| download | tidal-dl-ng-f413240b51f574c01144e6ae672b24c412a949e1.tar.gz | |
feat: Enhance playlist management and GUI logic
- Improved playlist item fetching by adding robust pagination and low-level request hooks for better testing and flexibility.
- Refactored track ID extraction logic into reusable helpers for clarity.
- Improved initialization for dialog components to avoid circular dependencies in the GUI.
- Added new unit tests to validate playlist operations, including track addition/removal and API integration.
- Updated metadata functions to simplify dictionary access using `.get` for better readability.
- Ensured PySide6 system dependencies are installed in GitHub Actions to address CI compatibility issues.
- Streamlined UI package initialization to improve modularity and robustness of imports.
Diffstat (limited to 'tidal_dl_ng/ui')
| -rw-r--r-- | tidal_dl_ng/ui/__init__.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tidal_dl_ng/ui/__init__.py b/tidal_dl_ng/ui/__init__.py index e69de29..3c4a724 100644 --- a/tidal_dl_ng/ui/__init__.py +++ b/tidal_dl_ng/ui/__init__.py @@ -0,0 +1,37 @@ +"""UI package initializer. + +- Ensures that `tidal_dl_ng.ui.dialog_playlist_manager` exposes both the generated + `Ui_DialogPlaylistManager` and the implementation `PlaylistManagerDialog`. +- Does not modify generated UI .py files; composes at import time. +""" + +from __future__ import annotations + +import importlib +from types import ModuleType + +# Import generated UI module +_ui_mod: ModuleType = importlib.import_module("tidal_dl_ng.ui.dialog_playlist_manager") + +# Attach the implementation class from gui +try: + from tidal_dl_ng.gui.dialog_playlist_manager import PlaylistManagerDialog as _ImplDialog +except Exception: + _ImplDialog = None # type: ignore[assignment] + +if _ImplDialog is not None: + _ui_mod.PlaylistManagerDialog = _ImplDialog + +# Re-export for convenience when importing from the package +if _ImplDialog is not None: + PlaylistManagerDialog = _ImplDialog # type: ignore[assignment] + +try: + from tidal_dl_ng.ui.dialog_playlist_manager import Ui_DialogPlaylistManager as _UiClass +except Exception: + _UiClass = None # type: ignore[assignment] + +if _UiClass is not None: + Ui_DialogPlaylistManager = _UiClass # type: ignore[assignment] + +__all__ = [name for name in ("PlaylistManagerDialog", "Ui_DialogPlaylistManager") if name in globals()] |
