From be7739713299476835faabac93241ed6754f25e4 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:07:27 -0700 Subject: [PATCH] Fix enrichment workers never showing idle/complete status Pending count queries included NULL-ID rows that _get_next_item filters out, so pending stayed > 0 even when no processable items remained. Workers reported running instead of idle, UI never turned green. Added AND id IS NOT NULL to _count_pending_items across all 9 workers to match the _get_next_item filter. --- core/audiodb_worker.py | 6 +++--- core/deezer_worker.py | 6 +++--- core/genius_worker.py | 4 ++-- core/itunes_worker.py | 6 +++--- core/lastfm_worker.py | 6 +++--- core/musicbrainz_worker.py | 6 +++--- core/qobuz_worker.py | 6 +++--- core/spotify_worker.py | 6 +++--- core/tidal_worker.py | 6 +++--- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/core/audiodb_worker.py b/core/audiodb_worker.py index cf4ef82e..f299cadd 100644 --- a/core/audiodb_worker.py +++ b/core/audiodb_worker.py @@ -558,9 +558,9 @@ class AudioDBWorker: cursor.execute(""" SELECT - (SELECT COUNT(*) FROM artists WHERE audiodb_match_status IS NULL) + - (SELECT COUNT(*) FROM albums WHERE audiodb_match_status IS NULL) + - (SELECT COUNT(*) FROM tracks WHERE audiodb_match_status IS NULL) + (SELECT COUNT(*) FROM artists WHERE audiodb_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM albums WHERE audiodb_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM tracks WHERE audiodb_match_status IS NULL AND id IS NOT NULL) AS pending """) diff --git a/core/deezer_worker.py b/core/deezer_worker.py index 8a4fe282..184579f9 100644 --- a/core/deezer_worker.py +++ b/core/deezer_worker.py @@ -631,9 +631,9 @@ class DeezerWorker: cursor.execute(""" SELECT - (SELECT COUNT(*) FROM artists WHERE deezer_match_status IS NULL) + - (SELECT COUNT(*) FROM albums WHERE deezer_match_status IS NULL) + - (SELECT COUNT(*) FROM tracks WHERE deezer_match_status IS NULL) + (SELECT COUNT(*) FROM artists WHERE deezer_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM albums WHERE deezer_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM tracks WHERE deezer_match_status IS NULL AND id IS NOT NULL) AS pending """) diff --git a/core/genius_worker.py b/core/genius_worker.py index caf16e26..31e2a1b2 100644 --- a/core/genius_worker.py +++ b/core/genius_worker.py @@ -464,8 +464,8 @@ class GeniusWorker: cursor = conn.cursor() cursor.execute(""" SELECT - (SELECT COUNT(*) FROM artists WHERE genius_match_status IS NULL) + - (SELECT COUNT(*) FROM tracks WHERE genius_match_status IS NULL) + (SELECT COUNT(*) FROM artists WHERE genius_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM tracks WHERE genius_match_status IS NULL AND id IS NOT NULL) AS pending """) row = cursor.fetchone() diff --git a/core/itunes_worker.py b/core/itunes_worker.py index 60342d46..72843af3 100644 --- a/core/itunes_worker.py +++ b/core/itunes_worker.py @@ -847,9 +847,9 @@ class iTunesWorker: cursor = conn.cursor() cursor.execute(""" SELECT - (SELECT COUNT(*) FROM artists WHERE itunes_match_status IS NULL) + - (SELECT COUNT(*) FROM albums WHERE itunes_match_status IS NULL) + - (SELECT COUNT(*) FROM tracks WHERE itunes_match_status IS NULL) + (SELECT COUNT(*) FROM artists WHERE itunes_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM albums WHERE itunes_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM tracks WHERE itunes_match_status IS NULL AND id IS NOT NULL) AS pending """) row = cursor.fetchone() diff --git a/core/lastfm_worker.py b/core/lastfm_worker.py index d162cef3..a8fc15dd 100644 --- a/core/lastfm_worker.py +++ b/core/lastfm_worker.py @@ -572,9 +572,9 @@ class LastFMWorker: cursor = conn.cursor() cursor.execute(""" SELECT - (SELECT COUNT(*) FROM artists WHERE lastfm_match_status IS NULL) + - (SELECT COUNT(*) FROM albums WHERE lastfm_match_status IS NULL) + - (SELECT COUNT(*) FROM tracks WHERE lastfm_match_status IS NULL) + (SELECT COUNT(*) FROM artists WHERE lastfm_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM albums WHERE lastfm_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM tracks WHERE lastfm_match_status IS NULL AND id IS NOT NULL) AS pending """) row = cursor.fetchone() diff --git a/core/musicbrainz_worker.py b/core/musicbrainz_worker.py index 3934c6f2..3ca79b5f 100644 --- a/core/musicbrainz_worker.py +++ b/core/musicbrainz_worker.py @@ -323,9 +323,9 @@ class MusicBrainzWorker: # Count unattempted items cursor.execute(""" SELECT - (SELECT COUNT(*) FROM artists WHERE musicbrainz_match_status IS NULL) + - (SELECT COUNT(*) FROM albums WHERE musicbrainz_match_status IS NULL) + - (SELECT COUNT(*) FROM tracks WHERE musicbrainz_match_status IS NULL) + (SELECT COUNT(*) FROM artists WHERE musicbrainz_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM albums WHERE musicbrainz_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM tracks WHERE musicbrainz_match_status IS NULL AND id IS NOT NULL) AS pending """) diff --git a/core/qobuz_worker.py b/core/qobuz_worker.py index 59abbac6..73eec1a4 100644 --- a/core/qobuz_worker.py +++ b/core/qobuz_worker.py @@ -754,9 +754,9 @@ class QobuzWorker: cursor.execute(""" SELECT - (SELECT COUNT(*) FROM artists WHERE qobuz_match_status IS NULL) + - (SELECT COUNT(*) FROM albums WHERE qobuz_match_status IS NULL) + - (SELECT COUNT(*) FROM tracks WHERE qobuz_match_status IS NULL) + (SELECT COUNT(*) FROM artists WHERE qobuz_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM albums WHERE qobuz_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM tracks WHERE qobuz_match_status IS NULL AND id IS NOT NULL) AS pending """) diff --git a/core/spotify_worker.py b/core/spotify_worker.py index 8e1d52ed..739154b1 100644 --- a/core/spotify_worker.py +++ b/core/spotify_worker.py @@ -892,9 +892,9 @@ class SpotifyWorker: cursor = conn.cursor() cursor.execute(""" SELECT - (SELECT COUNT(*) FROM artists WHERE spotify_match_status IS NULL) + - (SELECT COUNT(*) FROM albums WHERE spotify_match_status IS NULL) + - (SELECT COUNT(*) FROM tracks WHERE spotify_match_status IS NULL) + (SELECT COUNT(*) FROM artists WHERE spotify_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM albums WHERE spotify_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM tracks WHERE spotify_match_status IS NULL AND id IS NOT NULL) AS pending """) row = cursor.fetchone() diff --git a/core/tidal_worker.py b/core/tidal_worker.py index aaf57053..1e99ebb9 100644 --- a/core/tidal_worker.py +++ b/core/tidal_worker.py @@ -777,9 +777,9 @@ class TidalWorker: cursor.execute(""" SELECT - (SELECT COUNT(*) FROM artists WHERE tidal_match_status IS NULL) + - (SELECT COUNT(*) FROM albums WHERE tidal_match_status IS NULL) + - (SELECT COUNT(*) FROM tracks WHERE tidal_match_status IS NULL) + (SELECT COUNT(*) FROM artists WHERE tidal_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM albums WHERE tidal_match_status IS NULL AND id IS NOT NULL) + + (SELECT COUNT(*) FROM tracks WHERE tidal_match_status IS NULL AND id IS NOT NULL) AS pending """)