summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/gui.py
Commit message (Collapse)AuthorAgeFilesLines
* refactor: Restructure GUI components into separate modules for improved ↵Warry2025-12-041-1784/+7
| | | | maintainability
* Merge branch 'feature/json-downloaded' into fusion-refac-&-infoWarry2025-12-031-15/+627
|\ | | | | | | | | | | | | # Conflicts: # .gitignore # README.md # tidal_dl_ng/gui.py
| * feat: Add download history tracking with duplicate preventionWarry2025-11-291-1/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement comprehensive download history system with JSON persistence and duplicate prevention capabilities. Features: - Persistent JSON-based download history with atomic writes - Duplicate prevention toggle in Tools menu - Thread-safe operations with proper locking - Automatic corruption recovery with backup creation - Import/Export functionality for history portability - Statistics view grouped by source (playlist, album, mix) - Green console messages for improved visibility - Custom exception handling for better error reporting Technical Details: - HistoryService singleton with O(1) track lookups - Track-centric JSON structure for performance - Atomic file operations to prevent data corruption - Custom HistoryFormatError exception class - Complexity reduction through helper methods - Full AGENTS.md compliance (ruff, black, type hints) UI Changes: - Added "Tools" menu with two actions: - "View Download History..." - Opens history dialog - "Prevent Duplicate Downloads" - Toggle with persistence - New Download History dialog with: - Tree view grouped by source - Statistics display - Import/Export buttons - Clear history option - Open folder functionality Files Added: - tidal_dl_ng/history.py (438 lines) - tidal_dl_ng/dialog_history.py (325 lines) - tidal_dl_ng/ui/dialog_history.py - tidal_dl_ng/ui/dialog_history.ui - tests/test_history_service.py (38 tests) - tests/test_download_duplicate_prevention.py (10 tests) - tests/test_gui_duplicate_prevention.py (22 tests) - tests/test_logger_configuration.py (20 tests) - FEATURE_DOCUMENTATION.md (900+ lines) - tests/README.md - CODE_QUALITY_COMPLIANCE.md - FINAL_SUMMARY.md Files Modified: - tidal_dl_ng/download.py - History integration - tidal_dl_ng/gui.py - Tools menu and handlers - tidal_dl_ng/logger.py - Green INFO messages Testing: - 91 tests total, all passing (100% pass rate) - Full test coverage for all new functionality - Thread safety validated with concurrent tests - Corruption recovery tested - Import/Export functionality verified Quality: - Zero ruff violations (full AGENTS.md compliance) - All pre-commit hooks passing - Type hints on all functions - Google-style docstrings throughout - Black formatted - Security reviewed (subprocess usage annotated) Performance: - O(1) track existence checks via dict - Atomic writes prevent corruption - Minimal memory footprint (~100 bytes per track) - Fast startup (<50ms for 1000 tracks) Breaking Changes: None Backward Compatible: Yes (legacy format auto-migrated)
* | feat: enable rich text links for metadata fields and add search functionalityWarry2025-11-291-0/+47
| | | | | | | | | | | | | | | | - Introduced clickable metadata links (tracks, albums, artists, playlists, videos). - Left-click triggers in-app search; Ctrl+click or right-click opens browser search. - Enhanced label interactions and added tooltips for actionable fields. - Simplified artist, album, and playlist rendering with rich links. - Extended search functionality with URL-safe encoding and type mapping.
* | feat(hover): add track details preview on hover + fix all ruff violationsWarry2025-11-291-1501/+182
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement comprehensive track information display on hover and resolve all code quality issues to achieve complete ruff compliance. MAJOR FEATURES: - Track details preview on hover with rich metadata display - Async BPM fetching with loading indicator - Enhanced metadata utilities with fuzzy matching - TIDAL API extras integration FILES MODIFIED: 15+ files (core, UI, tests, docs) RUFF COMPLIANCE: 0 errors (89+ violations resolved) - Fixed E999 syntax error in metadata_utils.py - Refactored 10+ complex functions (C901) - Updated error handling (S110, S112, SIM105) - Modernized type hints (UP038) - Fixed naming conflicts (A001, F811) BUG FIXES: - Added missing _on_update_cover() method (11 test failures) - Fixed BPM display and async loading - Improved thread safety TESTING: 30 passed, 1 skipped DOCUMENTATION: Windows PowerShell support, tox troubleshooting
* feat(gui): ✨ add functionality to download albums from favoritesRobert Honz2025-11-121-0/+115
| | | | | | - Introduced a new context menu option to download all albums from selected favorites. - Implemented methods to handle downloading albums from favorite albums, artists, and tracks. - Enhanced logging for better tracking of the download process and errors.
* feat(gui): ✨ add favorites download functionalityRobert Honz2025-11-121-0/+50
| | | | | | * Implemented `on_download_favorites` method to allow users to download all items from a favorites category. * Added context menu option for downloading all items from favorites. * Enhanced error handling and logging for better user feedback.
* feat(gui): ✨ add folder support for media downloadsRobert Honz2025-11-121-5/+163
| | | | | | * Implemented context menu options for downloading playlists and albums from folders. * Added methods to fetch playlists and tracks from a folder. * Enhanced user experience by allowing bulk downloads from folder structures.
* feat(gui): ✨ enhance user media handling with folder supportRobert Honz2025-11-121-44/+212
| | | | | | * Updated `user_media_lists` to return a dictionary containing both `playlists` and `mixes`, including `Folder` objects. * Modified `on_populate_tree_lists` to handle `Folder` items and display their contents. * Introduced new methods for loading and displaying folder contents in the user interface.
* chore(gui): 🎨 update data file inclusion pattern for iconsRobert Honz2025-10-221-1/+1
| | | | | * Adjusted the pattern for including icon files to ensure proper matching. * This change enhances the flexibility of file inclusion during the build process.
* refactor(gui): ✨ update album download options and improve session validationRobert Honz2025-10-221-2/+4
| | | | | | * Added a new action to download all albums in a playlist. * Removed the deprecated `validate_session` method and replaced it with a direct call to `self.tidal.session.check_login()`. * Adjusted the UI layout in `dialog_settings` to accommodate new options and improved sizing.
* Merge pull request #596 from Winman486/fix/rate-limiting-playlist-downloadsexislow2025-10-221-3/+207
|\ | | | | Fix/rate limiting playlist downloads
| * refactor: Make rate limiting configurable and move session validation to ↵Winman4862025-10-211-21/+12
| | | | | | | | | | | | | | | | | | | | | | Tidal class - Add api_rate_limit_batch_size and api_rate_limit_delay_sec to Settings (cfg.py) - Move validate_session() and is_authentication_error() to Tidal class (config.py) - Update _load_albums_with_rate_limiting() to use config values instead of hardcoded 20/3 - Update _handle_album_load_error() to use Tidal.is_authentication_error() - Remove _validate_session() from gui.py (now uses Tidal.validate_session()) - Addresses maintainer feedback: configurable tweaking variables and proper separation of concerns
| * fix: Remove duplicate menu entry and reduce code complexityWinman4862025-10-201-69/+131
| | | | | | | | | | | | | | - Removed duplicate 'Download Full Album' context menu entry - Refactored on_download_all_albums_from_playlist to reduce C901 complexity - Extracted helper methods: _extract_album_ids_from_tracks, _load_albums_with_rate_limiting, _validate_session, _handle_album_load_error, _queue_loaded_albums - All make check errors and warnings now resolved
| * Merge upstream/master and resolve conflictsWinman4862025-10-201-90/+75
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | - Resolved conflict in dialog_settings.py (kept both cb_use_primary_album_artist and cb_mark_explicit checkboxes) - Fixed code quality issues found by make check: * Removed duplicate on_download_album_from_track function (F811) * Updated isinstance calls to use X | Y syntax instead of (X, Y) (UP038) * Fixed unused loop variable album_stub (B007) * Applied automatic formatting fixes (black, prettier, trailing whitespace) - Only remaining issue is C901 complexity warning in on_download_all_albums_from_playlist (expected per maintainer feedback)
| * | feat(gui): add rate limiting to Download All Albums feature - Process 20 ↵Winman4862025-10-171-5/+47
| | | | | | | | | | | | albums at a time with 3-second delays - Add session validity checks to prevent OAuth errors - Handle unavailable albums gracefully - Add informative logging for rate limiting progress
| * | feat(gui): add 'Download Full Album', 'Download All Albums', and 'Single ↵Winman4862025-10-171-1/+168
| | | | | | | | | | | | album folder (primary artist)' preference
* | | Merge pull request #573 from Rikrdoga/Dolby_Atmosexislow2025-10-221-3/+11
|\ \ \ | | | | | | | | Implement Dolby Atmos Support & API Key Selection
| * | | Apply formatter and fix TRY003Rikrdoga2025-10-201-2/+2
| | | |
| * | | Refactor Dolby Atmos ImplementationRikrdoga2025-10-201-16/+6
| | | |
| * | | Refactor Dolby Atmos feature to be internal and seamlessRikrdoga2025-10-201-39/+17
| | | |
| * | | Add support for Dolby AtmosRikrdoga2025-10-201-2/+42
| | |/ | |/|
* / | fix(gui): 🐛 integrate `ansi2html` for improved log message formattingRobert Honz2025-10-211-5/+7
|/ / | | | | | | | | | | * Added `Ansi2HTMLConverter` to convert ANSI color codes in log messages to HTML. * Updated the `MainWindow` class to utilize the new converter for displaying logs. * Removed dependency on `coloredlogs.converter` for log message display.
* | fix(gui): 🐛 improve album download action and update docstringRobert Honz2025-10-201-5/+10
| | | | | | | | | | * Refactored the menu action for downloading the full album from a track. * Enhanced the docstring for `on_download_album_from_track` to clarify its functionality and error handling.
* | feat: Add 'Download Full Album' from track context menuRikrdoga2025-10-171-0/+38
|/
* Queue button should indicate the action that will occur when clicked — ↵Robert Honz2025-10-171-4/+4
| | | | | | currently it shows present state Fixes #561
* fix(gui): 🐛 adjust MainWindow initialization and clean up close event methodRobert Honz2025-09-301-1/+1
| | | | | * Added a missing line in the `MainWindow` constructor to ensure proper settings initialization. * Removed unnecessary blank line in the `closeEvent` method for cleaner code.
* Merge pull request #517 from joshuacant/masterexislow2025-09-301-5/+24
|\ | | | | Adds: window size/position saving, dynamic column widths, double-click row action
| * move window size and position restore into the correct functionJoshua Cantara2025-09-081-7/+6
| |
| * set column widths dynamically based on window widthJoshua Cantara2025-09-011-3/+9
| |
| * save and restore main window position and sizeJoshua Cantara2025-09-011-1/+14
| |
| * double click a result row to download itJoshua Cantara2025-09-011-0/+1
| |
* | feat(tidal): ✨ add url_ending_clean function and refactor URL handling. ↵Robert Honz2025-09-071-5/+7
|/ | | | | | | Fixes #523 * Introduced `url_ending_clean` to sanitize URLs by removing trailing "/u" or "?u". * Updated `_process_url` and GUI search logic to utilize cleaned URLs for better validation and processing.
* feat(gui): enhance app icons with multi-resolution supportRobert Honz2025-08-121-3/+8
| | | | | | | | | | | | Improves the application's icon handling by introducing multi-resolution support, replacing a single PNG file with multiple resolution-specific icons. - ✨ **Added** multiple resolution icons (16x16, 32x32, 48x48, 64x64, 256x256, 512x512). - 🔄 **Updated** GUI setup to use multi-resolution icons for better scalability. - 🗑️ **Removed** the old single-resolution `icon.png`. This update ensures better compatibility and visual quality across different platforms and screen resolutions.
* refactor(gui): ✨ Enhance type annotations and improve method signaturesRobert Honz2025-07-021-17/+17
| | | | | | * Updated type hints for various methods in and classes. * Changed list types from to for better clarity and consistency. * Improved function signatures to include return types for better type safety.
* refactor(gui): ✨ Improve filter handling in `MainWindow`Robert Honz2025-07-011-5/+7
| | | | | | * Refactored the filter extraction logic to directly use `header.filter_text(i)` for better clarity. * Updated the filters list to store tuples of index and text, enhancing the data structure used. * Ensured that the `proxy_model.filters` is set directly, simplifying the code.
* refactor(gui): ✨ Enhance type annotations and improve method signaturesRobert Honz2025-07-011-45/+45
| | | | | | * Updated type hints for several methods in `MainWindow` class to improve code clarity and type safety. * Changed return types to `None` where applicable. * Refined parameter types for better type checking and consistency.
* refactor(gui): ✨ Enhance documentation for `MainWindow` methodsRobert Honz2025-07-011-41/+451
| | | | | | * Added detailed docstrings for methods in the `MainWindow` class. * Improved clarity on parameters and return types for better understanding. * Aims to facilitate future development and maintenance.
* refactor(gui): ✨ Improve `search_result_to_model` method and extract ↵Robert Honz2025-07-011-105/+141
| | | | | | | | | helper functions * Refactored `search_result_to_model` to use type hints with `list` instead of `[*SearchTypes]`. * Added detailed docstring for better understanding of parameters and return types. * Extracted logic into helper methods for better readability and maintainability. * Improved handling of item availability and explicit content representation.
* ✨ Either date added or date released will be shown, depending if a list is ↵Robert Honz2025-06-301-8/+23
| | | | selected or a search was performed. Fixes #424
* 🛠️ Favorites won't getting duplicated after user hits the list reload ↵Robert Honz2025-06-301-0/+5
| | | | button. Fixes #409
* 🛠️ Cover won't be removed, if clicked on the same item multiple times.Robert Honz2025-06-291-1/+5
|
* ✨ Spinner will be shown, if search results are expanded.Robert Honz2025-06-291-1/+9
|
* 🛠️ GUI dos not hang if searched media is not available anymore.Robert Honz2025-06-291-0/+3
|
* 👷 Lists and cover will be loaded in background. Gui won't hang anymore. ↵Robert Honz2025-06-291-27/+71
| | | | Fixes #423
* Fix: Prevent UnboundLocalError in on_populate_tree_listsJuan Jesús Alejo Sillero2025-04-261-0/+2
| | | | | - Added a safeguard to skip items in `user_lists` that do not match expected types (`UserPlaylist`, `Playlist`, or `Mix`). - Ensured `twi_child` is only accessed when properly initialized. - This prevents crashes during GUI interaction when unexpected data is encountered.
* Fixed: Relative import error.Robert Honz2025-03-231-2/+1
|
* 🛠️ Clipboard is not thread safe. Executing in a synchronous way. Fixes #382Robert Honz2025-03-231-5/+2
|
* ✨ Downloads can be now paused / resumed. Fixes #149 & 324Robert Honz2025-03-031-2/+50
| | | | 👷 Shutdown is handled more gracefully.
* 🛠️ Fix: Missing module prefix on import. Fixes #335Robert Honz2025-01-141-1/+2
|