feat: Refactor playlist management, error handling, and testing infrastructure
- Improved playlist item handling with pagination, error logging, and dedicated request hooks. - Consolidated reusable helpers for track ID normalization, playlist validation, and removal logic. - Enhanced error handling by introducing `PlaylistNotFound` and `UserNotAuthenticated` exceptions. - Refined Pytest `qapp` fixture for headless CI compatibility and session-scoped reuse. - Replaced redundant fixtures in multiple test files for consistency. - Improved playlist management GUI with detailed debug logging for notifications and operations. - Added `deptry` configuration to handle transitive dependencies and ignored exclusions. - Updated Pytest and Tox configurations for consistent environment setup during CI/CD runs.
This commit is contained in:
@@ -508,14 +508,16 @@ class PlaylistContextLoader(QtCore.QRunnable):
|
||||
Set of track UUIDs in this playlist
|
||||
"""
|
||||
try:
|
||||
# If a low-level request hook is present, use it to fetch all items
|
||||
req = getattr(self.session, "request", None)
|
||||
if callable(req):
|
||||
return self._fetch_via_request_hook(playlist_uuid, playlist_name)
|
||||
|
||||
return self._fetch_via_tidalapi(playlist_uuid, playlist_name)
|
||||
|
||||
except RequestException:
|
||||
raise
|
||||
except Exception as e:
|
||||
logger_gui.debug(f"Unexpected error fetching items for {playlist_uuid}: {e}")
|
||||
raise RequestException(f"Failed to fetch items for playlist {playlist_uuid}: {e}") from e # noqa: TRY003
|
||||
|
||||
def request_abort(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user