fix spotify playlist discover automation

This commit is contained in:
Broque Thomas 2026-03-05 21:17:58 -08:00
parent 551cd95064
commit 17babb1fc8

View file

@ -20082,14 +20082,13 @@ def _run_playlist_discovery_worker(playlists, automation_id=None):
total_tracks = 0
last_playlist_name = ''
# Pre-compute grand total for progress tracking (skip spotify playlists)
# Pre-compute grand total for progress tracking
grand_total = 0
db_init = get_database()
for pl in playlists:
if pl.get('source', '') != 'spotify':
t = db_init.get_mirrored_playlist_tracks(pl['id'])
if t:
grand_total += len(t)
t = db_init.get_mirrored_playlist_tracks(pl['id'])
if t:
grand_total += len(t)
_update_automation_progress(automation_id, total=grand_total)
for pl in playlists:
@ -20098,10 +20097,6 @@ def _run_playlist_discovery_worker(playlists, automation_id=None):
last_playlist_name = pl_name
source = pl.get('source', '')
# Spotify playlists are auto-discovered during refresh
if source == 'spotify':
continue
db = get_database()
tracks = db.get_mirrored_playlist_tracks(pl_id)
if not tracks: