Commit Graph

154 Commits

Author SHA1 Message Date
oop7 e43b1bbb2e Optimize format table filtering and rebuilding
Refactors the format table logic to build the table once and use row visibility for fast filtering between video and audio formats. Adds internal flags to track table state and format types per row, improving performance and responsiveness when toggling format filters. Also streamlines table population and color-coding logic.
2026-01-24 17:21:24 +02:00
oop7 66870d062b Centralize file extension constants in ytsage_constants
Moved video, audio, and subtitle file extension lists to ytsage_constants.py as centralized frozenset constants. Updated all usages in downloader and GUI modules to reference these constants, reducing duplication and improving maintainability.
2026-01-24 17:01:45 +02:00
oop7 6c9a62f6b8 Improve update check with parallel network requests
Refactored UpdateCheckThread to use ThreadPoolExecutor for parallel requests to PyPI and GitHub, reducing total wait time. Added error handling and timeouts for faster failure detection, and improved changelog fetching with a fallback message.
2026-01-24 16:58:17 +02:00
oop7 b9b0285e95 Refactor config handling to use ConfigManager
Replaced direct usage of load_config and save_config with ConfigManager in ytsage_utils.py and ytsage_dialogs_update.py. Removed legacy config functions from ytsage_utils.py to centralize configuration management and improve maintainability.
2026-01-24 16:54:08 +02:00
oop7 02ede913d2 Refactor analysis to use QThread for thread safety
Replaces the use of Python's threading with a dedicated QThread-based AnalysisThread for URL analysis, ensuring all UI updates are performed via Qt signals for thread safety. Adds cancellation support for analysis, improves error handling, and updates the main window's close event to properly terminate the analysis thread if running. This refactor enhances stability and responsiveness of the GUI during analysis operations.
2026-01-24 16:50:24 +02:00
oop7 64560fabb2 Replace pyglet with QtMultimedia for audio playback
Removed pyglet dependency and migrated notification sound playback to use PySide6.QtMultimedia's QMediaPlayer and QAudioOutput. Updated workflow and requirements files to remove pyglet and ensure PySide6.QtMultimedia is included in build steps.
2026-01-24 16:25:52 +02:00
oop7 d5d7a0186d Refactor analysis logic into AnalysisMixin
Moved all analysis-related methods from YTSageApp in ytsage_gui_main.py to a new AnalysisMixin in ytsage_gui_analysis.py. This improves code organization and separation of concerns by isolating analysis logic from the main application class.
2026-01-24 14:00:13 +02:00
oop7 370836b814 Refactor GUI styles to use centralized StyleSheet class
Moved all inline widget style definitions in ytsage_gui_main.py to named constants in the StyleSheet class in ytsage_stylesheet.py. This centralizes and simplifies style management, improves maintainability, and ensures consistent theming across the application.
2026-01-24 13:46:16 +02:00
oop7 9759fa565f Refactor UI startup and stylesheet handling
Moved the main application stylesheet to a new src/gui/ytsage_stylesheet.py module and applied it via StyleSheet.MAIN. Deferred blocking startup checks (FFmpeg, yt-dlp, Deno, updates) until after the UI is shown to improve responsiveness. Improved subtitle file deletion logic and added destination filename capture in downloader. Added custom style for auto-update checkbox in updater dialog.
2026-01-24 13:35:02 +02:00
oop7 4d4d9e10b9 Refactor updater checks to use QThread for async operations
Replaces manual threading for FFmpeg and Deno version checks with dedicated QThread subclasses (FFmpegCheckThread and DenoCheckThread). This improves integration with the Qt event loop, enables use of signals and slots for UI updates, and enhances error handling.
2026-01-24 12:57:37 +02:00
oop7 a871ded15f Move update check to background thread
Refactored the update checking logic into a QThread subclass to prevent blocking the UI during network requests. The update check now runs asynchronously, and the dialog is shown via a signal when an update is available.
2026-01-24 12:52:48 +02:00
oop7 e2c4dfea4e Increase menu button area in history delegate
Expanded the clickable area for the menu button in HistoryDelegate to 60x50px and adjusted text width accordingly. This improves usability and addresses issues with the left side of the button not responding to clicks.
2026-01-21 18:10:34 +02:00
oop7 7c2e461141 Refactor HistoryManager to use persistent DB connection
Replaces per-operation SQLite connections with a persistent connection for improved efficiency and thread safety. Adds additional indexes for faster search on title, channel, and URL. Refactors all database access methods to use the persistent connection and simplifies transaction handling.
2026-01-21 18:05:17 +02:00
oop7 5f17fabc50 Refactor history dialog to use virtualized list and SQLite
Replaces the history dialog's widget-per-entry approach with a virtualized QListView using a custom model and delegate for improved performance. Switches the HistoryManager backend from JSON file storage to SQLite, including automatic migration of legacy data. Adds support for efficient search, thumbnail caching, and context menu actions in the new UI.
2026-01-21 17:56:56 +02:00
oop7 29f713cf17 Refine HistoryEntryWidget layout and sizing
Adjusted padding, margin, and spacing for a more compact layout. Standardized the thumbnail size to 240x135 (16:9 ratio) and reduced the menu button size for better visual balance.
2026-01-21 17:19:49 +02:00
oop7 ea54f469ac Improve history loading and thumbnail caching UX
Refactors the history loading process to emit entries as soon as they are loaded, allowing the UI to display immediately. Thumbnail downloads are now handled in the background, with widgets updated via a new signal when thumbnails are cached. This prevents UI freezes and improves responsiveness by showing placeholders until thumbnails are available.
2026-01-21 17:16:48 +02:00
oop7 a92ffd3b01 Download video thumbnails asynchronously in GUI
Refactored thumbnail downloading to use a QThread for asynchronous operation, preventing UI blocking. Added ThumbnailDownloadThread class and updated VideoInfoMixin to handle threaded download and error reporting.
2026-01-21 17:16:35 +02:00
oop7 0d1eb35ba2 Add debug log for yt-dlp command execution
Inserted a debug log statement to output the full yt-dlp command before execution. This will help diagnose issues related to command construction and subprocess invocation.
2026-01-21 15:15:14 +02:00
oop7 5ed67cb32f Bump version to 5.0.0b
Update the __version__ string to 5.0.0b to reflect the next major beta release.
2026-01-17 21:58:50 +02:00
oop7 67fdb508f4 Optimize playlist extraction with yt-dlp flat-playlist
Switches to using yt-dlp's --flat-playlist and --dump-single-json for faster initial playlist info extraction. Now fetches minimal info for all videos quickly, then retrieves full details for the first video only to populate format information, improving performance and reducing unnecessary data processing.
2026-01-17 21:43:08 +02:00
oop7 ffb938b181 Add playlist filter and show video durations in selection dialog
Introduces a filter input to the PlaylistSelectionDialog for searching videos by title and displays video durations next to each entry. Updates English translations to support the new filter placeholder and analysis status message.
2026-01-17 21:43:01 +02:00
oop7 2b7cce1333 Add threaded loading and spinner to history dialog
Introduces a HistoryLoaderThread to load history entries and pre-fetch thumbnails in the background, preventing UI freezes. Adds a loading spinner and disables the 'Clear All' button while loading, improving user experience during history retrieval.
2026-01-17 21:26:26 +02:00
oop7 fd192455f5 Handle Path objects in config JSON serialization
Added a custom converter to serialize Path objects as strings when saving the application configuration to JSON. This prevents serialization errors if Path objects are present in the config.
2026-01-17 21:21:06 +02:00
oop7 f8f2910f06 Fix f-string backslash SyntaxError in AboutDialog
Refactored AboutDialog to avoid backslashes in f-string expressions by assigning HTML links to variables before formatting. This resolves a SyntaxError encountered when running YTSage with Python 3.11.
2026-01-17 21:10:01 +02:00
oop7 c16e84105e Increase subprocess timeout to 300 seconds
Extended the timeout for the subprocess running yt-dlp from 60 to 300 seconds to accommodate longer-running download or processing tasks.
2026-01-17 21:01:52 +02:00
oop7 26d063327c Fix indentation for zip extraction block
Corrected the indentation so that the extraction of the executable occurs within the context of the open zip file. This ensures the file is extracted while the zip is accessible, preventing potential errors.
2026-01-07 18:45:51 +02:00
oop7 a4df946169 Fix extraction path for Deno executable
Changed the extraction target directory for the Deno executable to use the parent of DENO_APP_BIN_PATH instead of APP_BIN_DIR, ensuring the executable is placed in the correct location.
2026-01-07 18:32:20 +02:00
oop7 c7751edd91 Add DENO_APP_BIN_PATH env override and Flatpak support
Introduces support for overriding DENO_APP_BIN_PATH via environment variable, enabling compatibility with Flatpak packaging. Updates the build workflow to set the DENO_APP_BIN_PATH environment variable and ensures parent directories for custom binary paths are created if needed.
2026-01-07 18:11:06 +02:00
oop7 f7cf752fb2 Bump version to 4.9.8b
Update the __version__ string in src/__init__.py to 4.9.8b to reflect the latest changes.
2026-01-06 17:22:14 +02:00
oop7 f1d1a68d32 Merge branch 'beta' 2026-01-06 16:14:15 +02:00
oop7 0b5b5b3189 Add Flatpak build support and env override for yt-dlp path
Introduces a Flatpak packaging step to the Linux CI workflow and updates ytsage_constants.py to support overriding the yt-dlp binary path via the YTDLP_APP_BIN_PATH environment variable, which is critical for Flatpak compatibility. Also ensures the custom yt-dlp directory is created if the environment variable is set.
2026-01-06 16:13:21 +02:00
oop7 192841a836 Bump version to 4.9.7
Update the __version__ string in src/__init__.py from 4.9.7b to 4.9.7, indicating a release from beta to stable.
2025-12-26 23:39:28 +02:00
oop7 5a996efd19 Bump version to 4.9.7b
Updated the __version__ string in src/__init__.py to reflect the new release version 4.9.7b.
2025-12-11 11:06:05 +02:00
oop7 d45a4a35a4 Add update-in-progress handling and translations
Introduces 'update in progress' messages to all supported languages and updates the GUI to prevent analysis or downloads while yt-dlp is updating. Adds flags to track update and analysis states, ensuring user actions are blocked with appropriate warnings during updates.
2025-12-09 20:53:20 +02:00
oop7 b70dfb58e7 Adjust QLineEdit padding in main GUI
Reduced the vertical padding of QLineEdit elements from 12px to 5px to improve the appearance and spacing in the main application window.
2025-12-09 20:36:07 +02:00
oop7 f644581953 Improve SHA256 checksum parsing for Deno
Enhances the verify_deno_sha256 function to support both standard Unix and verbose checksum file formats. Adds debug logging for cases where the hash cannot be found.
2025-12-09 19:32:01 +02:00
oop7 bfd30513f6 Refine input and button styles in main and video info UI
Improved the appearance and spacing of the URL input, paste, and analyze buttons in the main GUI, including updated padding, border, and color styles. Adjusted font sizes and colors for video info labels for a more consistent and polished look.
2025-12-06 21:40:59 +02:00
oop7 835ae45121 Disable editing in format table
Set the format table's edit triggers to NoEditTriggers to prevent cell editing and avoid selection box on double-click.
2025-12-06 21:40:49 +02:00
oop7 83d37676ae Suppress output when killing process tree on Windows
Replaces capture_output with stdout and stderr redirected to DEVNULL in subprocess.run for taskkill, preventing codec issues and suppressing command output.
2025-11-29 14:44:39 +02:00
oop7 478daf4771 Improve process termination and file cleanup logic
Enhanced cross-platform process tree termination for downloads, using process groups on Unix and taskkill on Windows. Improved file deletion reliability by increasing retries, adding garbage collection, and adjusting backoff logic. Refactored process startup to support process group management and ensured proper resource cleanup after cancellation.
2025-11-29 14:09:05 +02:00
oop7 9d1f886305 Update subprocess to use encoding and error handling
Replaces 'text' and 'universal_newlines' parameters with 'encoding="utf-8"' and 'errors="replace"' in subprocess.Popen for improved output handling.
2025-11-29 13:58:16 +02:00
oop7 62298dabf3 Enable analyze button only when URL is entered
Added logic to disable the analyze button until a non-empty URL is entered. Updated button styling for the disabled state and ensured consistent enabling/disabling of the analyze button based on input and control state.
2025-11-29 13:47:10 +02:00
oop7 15451f7715 Switch update checks from GitHub API to PyPI
Update logic in updater dialog and main app to fetch latest version info from PyPI instead of GitHub API, avoiding rate limiting issues. Changelog is now fetched from GitHub only as a fallback, improving reliability of update checks.
2025-11-29 13:31:57 +02:00
oop7 b58b1a6857 Persist cookie settings using ConfigManager
Refactored cookie settings initialization and application to use ConfigManager for persistence. Cookie source, browser, profile, file path, and active status are now saved and loaded from config, ensuring consistent behavior across sessions. Cookies remain inactive on app launch until explicitly applied by the user.
2025-11-28 18:18:57 +02:00
oop7 fc719a8cc8 Add thumbnail status messages and refactor thumbnail saving
Added new localized status messages for thumbnail saving in all supported languages. Refactored the thumbnail saving logic in ytsage_gui_video_info.py to use cached images from analysis instead of extracting via yt-dlp subprocess, improving reliability and performance.
2025-11-28 18:00:56 +02:00
oop7 7a6aaa6704 Bump version to 4.9.6b
Updated the __version__ string in src/__init__.py to 4.9.6b for the next development release.
2025-11-28 17:44:23 +02:00
oop7 c2a8cbd679 Update version to 4.9.5 in __init__.py
Removed the beta suffix from the version string, indicating a stable release.
2025-11-27 18:15:32 +02:00
oop7 3f0db8208b Add audio format settings update in preferences
Audio format settings (force and preferred) are now updated from the preferences dialog. Tooltip update logic is extended to reflect changes in audio format settings.
2025-11-17 15:26:37 +02:00
oop7 f2b6dc26cb Add audio format selection for audio-only downloads
Introduces settings and UI for forcing audio format conversion on audio-only downloads, including support for selecting preferred audio formats. Updates language files for all supported languages, adds config options, and passes new settings through the downloader and main app logic.
2025-11-17 15:23:48 +02:00
oop7 d5c3b4799b Add explicit type annotations across core modules
Introduced explicit type annotations for variables, function arguments, and return types in ytsage_downloader.py, ytsage_utils.py, and ytsage_config_manager.py. This improves code clarity, maintainability, and static analysis support.
2025-11-15 18:31:16 +02:00