From b3206d88908ff0b4bfcfb5c5d04ffeb1b967d98b Mon Sep 17 00:00:00 2001 From: oop7 <110548351+oop7@users.noreply.github.com> Date: Tue, 4 Nov 2025 22:06:30 +0200 Subject: [PATCH] Remove redundant file existence check in downloader Eliminated the check_file_exists method and related logic, as file existence is now handled by yt-dlp itself. This simplifies the DownloadThread class and avoids unnecessary pre-download checks. --- src/core/ytsage_downloader.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/core/ytsage_downloader.py b/src/core/ytsage_downloader.py index d667f48..6dcfea0 100644 --- a/src/core/ytsage_downloader.py +++ b/src/core/ytsage_downloader.py @@ -88,8 +88,6 @@ class DownloadThread(QThread): self.paused = False self.cancelled = False self.process = None - self.last_output_time = time.time() - self.timeout_timer = None self.current_filename = None # Initialize filename storage self.last_file_path = None # Initialize full file path storage self.subtitle_files = [] # Track subtitle files that are created @@ -158,13 +156,6 @@ class DownloadThread(QThread): except Exception as e: logger.exception(f"Error cleaning subtitle files: {e}") - def check_file_exists(self) -> bool | None: - """Check if the file already exists before downloading""" - # This method is kept for backwards compatibility but always returns False - # to proceed with download. File existence is now handled by yt-dlp CLI itself. - logger.debug("Skipping file existence check (handled by yt-dlp)") - return False # Proceed with download attempt - def _build_yt_dlp_command(self) -> list: """Build the yt-dlp command line with all options for direct execution.""" # Use the new yt-dlp path function from ytsage_yt_dlp module @@ -295,15 +286,6 @@ class DownloadThread(QThread): try: logger.debug("Starting download thread") - # First check if file already exists using original method - existing_file = self.check_file_exists() - if existing_file: - logger.debug(f"File exists, emitting signal: {existing_file}") - self.file_exists_signal.emit(existing_file) - return - - logger.debug("No existing file found, proceeding with download") - # Get initial list of subtitle files to compare later self.initial_subtitle_files = set() if self.merge_subs: