From c728309a09ab61bd1cb624a665b86adf48c9418e Mon Sep 17 00:00:00 2001 From: Broque Thomas Date: Mon, 26 Jan 2026 15:35:42 -0800 Subject: [PATCH] Fix automatic wishlist addition for failed/cancelled tracks in download modal Issue: Tracks marked as failed or cancelled in the download missing tracks modal were not being automatically added to the wishlist on completion, despite manual "Add to Wishlist" button working correctly. Modal completed silently without mentioning wishlist. Root cause: Line 549 in web_server.py was calling _on_download_completed() with wrong parameters - missing batch_id. This caused the completion handler to look up wrong batch, return early, and never process failed tracks to wishlist. The bug affected downloads that complete via monitor detection (YouTube, Soulseek) since the monitor loop calls this function when it detects completed transfers. Fix: Added missing batch_id parameter to _on_download_completed() call on line 549. Changed: _on_download_completed(task_id, success=True) To: _on_download_completed(batch_id, task_id, success=True) Tested: Automatic wishlist addition now works correctly for failed/cancelled tracks. --- web_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_server.py b/web_server.py index f5255d62..0729de97 100644 --- a/web_server.py +++ b/web_server.py @@ -546,7 +546,7 @@ class WebUIDownloadMonitor: # 'Completed' is used by YouTubeClient, 'Succeeded' by Soulseek if state in ['Completed', 'Succeeded'] and task['status'] == 'downloading': print(f"✅ Monitor detected completed download for {task_id} ({state}) - triggering post-processing") - _on_download_completed(task_id, success=True) + _on_download_completed(batch_id, task_id, success=True) # ENHANCED: Add worker count validation to detect ghost workers self._validate_worker_counts()