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:
@@ -507,7 +507,7 @@ class DownloadThread(QThread):
|
|||||||
)
|
)
|
||||||
return
|
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)
|
self.progress_signal.emit(100)
|
||||||
|
|
||||||
# Robust file finding: Always search for the most recent file
|
# 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)
|
logger.error(f"Error finding final file: {e}", exc_info=True)
|
||||||
|
|
||||||
# Set completion status
|
# Set completion status
|
||||||
|
if return_code != 0:
|
||||||
|
self.status_signal.emit(_("download.completed") + " (with some errors)")
|
||||||
|
else:
|
||||||
self.status_signal.emit(_("download.completed"))
|
self.status_signal.emit(_("download.completed"))
|
||||||
|
|
||||||
# Clean up subtitle files if they were merged, with a small delay
|
# Clean up subtitle files if they were merged, with a small delay
|
||||||
|
|||||||
Reference in New Issue
Block a user