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.
This commit is contained in:
parent
450e246b77
commit
04f958d88e
1 changed files with 6 additions and 2 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue