From 04f958d88e46b0349bdc9b6aedaa30f52a7eed2e Mon Sep 17 00:00:00 2001 From: JohnBaumb <80135794+JohnBaumb@users.noreply.github.com> Date: Thu, 23 Apr 2026 13:40:10 -0700 Subject: [PATCH] fix: server push status NameError in completion handlers - Replace bare 'database' references with get_database() calls in both completion handlers (NameError was silently swallowed, leaving server_push_status null even after successful Navidrome pushes). - Add playlist_id and playlist_name to download_missing batch dicts so the push prefix check fires for those code paths. --- web_server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web_server.py b/web_server.py index 6af8d1e6..d3264873 100644 --- a/web_server.py +++ b/web_server.py @@ -28931,7 +28931,7 @@ def _on_download_completed(batch_id, task_id, success=True): 'listenbrainz_', 'beatport_', ) if playlist_id and playlist_id.startswith(_push_prefixes): - database.update_sync_history_push_status(batch_id, 'pending') + get_database().update_sync_history_push_status(batch_id, 'pending') threading.Thread( target=_push_playlist_to_server, args=(batch_id, batch), @@ -31161,6 +31161,8 @@ def start_playlist_missing_downloads(playlist_id): 'active_count': 0, 'max_concurrent': _get_max_concurrent(), 'queue_index': 0, + 'playlist_id': playlist_id, + 'playlist_name': playlist_name, # Track state management (replicating sync.py) 'permanently_failed_tracks': [], 'cancelled_tracks': set(), @@ -32197,7 +32199,7 @@ def _check_batch_completion_v2(batch_id): 'listenbrainz_', 'beatport_', ) if playlist_id and playlist_id.startswith(_push_prefixes): - database.update_sync_history_push_status(batch_id, 'pending') + get_database().update_sync_history_push_status(batch_id, 'pending') threading.Thread( target=_push_playlist_to_server, args=(batch_id, batch), @@ -33613,6 +33615,8 @@ def start_missing_downloads(): 'active_count': 0, 'max_concurrent': _get_max_concurrent(), 'queue_index': 0, + 'playlist_id': playlist_id, + 'playlist_name': 'Legacy Modal', # Track state management (replicating sync.py) 'permanently_failed_tracks': [], 'cancelled_tracks': set(),