fix spotify playlist discover automation
This commit is contained in:
parent
551cd95064
commit
17babb1fc8
1 changed files with 4 additions and 9 deletions
|
|
@ -20082,14 +20082,13 @@ def _run_playlist_discovery_worker(playlists, automation_id=None):
|
||||||
total_tracks = 0
|
total_tracks = 0
|
||||||
last_playlist_name = ''
|
last_playlist_name = ''
|
||||||
|
|
||||||
# Pre-compute grand total for progress tracking (skip spotify playlists)
|
# Pre-compute grand total for progress tracking
|
||||||
grand_total = 0
|
grand_total = 0
|
||||||
db_init = get_database()
|
db_init = get_database()
|
||||||
for pl in playlists:
|
for pl in playlists:
|
||||||
if pl.get('source', '') != 'spotify':
|
t = db_init.get_mirrored_playlist_tracks(pl['id'])
|
||||||
t = db_init.get_mirrored_playlist_tracks(pl['id'])
|
if t:
|
||||||
if t:
|
grand_total += len(t)
|
||||||
grand_total += len(t)
|
|
||||||
_update_automation_progress(automation_id, total=grand_total)
|
_update_automation_progress(automation_id, total=grand_total)
|
||||||
|
|
||||||
for pl in playlists:
|
for pl in playlists:
|
||||||
|
|
@ -20098,10 +20097,6 @@ def _run_playlist_discovery_worker(playlists, automation_id=None):
|
||||||
last_playlist_name = pl_name
|
last_playlist_name = pl_name
|
||||||
source = pl.get('source', '')
|
source = pl.get('source', '')
|
||||||
|
|
||||||
# Spotify playlists are auto-discovered during refresh
|
|
||||||
if source == 'spotify':
|
|
||||||
continue
|
|
||||||
|
|
||||||
db = get_database()
|
db = get_database()
|
||||||
tracks = db.get_mirrored_playlist_tracks(pl_id)
|
tracks = db.get_mirrored_playlist_tracks(pl_id)
|
||||||
if not tracks:
|
if not tracks:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue