Handle playlist items as completed on partial errors

For playlist downloads, treat an item as completed if a file was created even when the downloader returned a non-zero code. Emit 100% progress for such cases and update the status to "download.completed (with some errors)" when return_code != 0, otherwise keep the normal completed status. This avoids reporting false failures for playlist items that produced output despite errors.
This commit is contained in:
oop7
2026-05-14 13:47:05 +03:00
parent 99ba5d6d8a
commit 9fd09cd0d0
+4 -1
View File
@@ -507,7 +507,7 @@ class DownloadThread(QThread):
)
return
if return_code == 0:
if return_code == 0 or (self.is_playlist and return_code != 0 and self.current_filename is not None):
self.progress_signal.emit(100)
# Robust file finding: Always search for the most recent file
@@ -556,6 +556,9 @@ class DownloadThread(QThread):
logger.error(f"Error finding final file: {e}", exc_info=True)
# Set completion status
if return_code != 0:
self.status_signal.emit(_("download.completed") + " (with some errors)")
else:
self.status_signal.emit(_("download.completed"))
# Clean up subtitle files if they were merged, with a small delay