Fix chromaprint crash on surround audio and Spotify worker status display

This commit is contained in:
Broque Thomas 2026-03-04 11:00:34 -08:00
parent 548b5cfbdf
commit 2d6c55e294
3 changed files with 21 additions and 10 deletions

View file

@ -124,9 +124,12 @@ class SpotifyWorker:
# Auth guard — don't process anything without Spotify auth
if not self.client.is_spotify_authenticated():
logger.debug("Spotify not authenticated, sleeping 30s...")
time.sleep(30)
continue
# Try reloading config in case user re-authenticated via settings
self.client.reload_config()
if not self.client.is_spotify_authenticated():
logger.debug("Spotify not authenticated, sleeping 30s...")
time.sleep(30)
continue
self.current_item = None
item = self._get_next_item()

View file

@ -3685,6 +3685,9 @@ def spotify_callback():
if spotify_client.is_authenticated():
# Invalidate status cache so next poll picks up the new connection
_status_cache_timestamps['spotify'] = 0
# Refresh enrichment worker's client so it picks up new auth
if spotify_enrichment_worker and hasattr(spotify_enrichment_worker, 'client'):
spotify_enrichment_worker.client.reload_config()
add_activity_item("", "Spotify Auth Complete", "Successfully authenticated with Spotify", "Now")
return "<h1>Spotify Authentication Successful!</h1><p>You can close this window.</p>"
else:
@ -28322,6 +28325,9 @@ def start_oauth_callback_servers():
if spotify_client.is_authenticated():
# Invalidate status cache so next poll picks up the new connection
_status_cache_timestamps['spotify'] = 0
# Refresh enrichment worker's client so it picks up new auth
if spotify_enrichment_worker and hasattr(spotify_enrichment_worker, 'client'):
spotify_enrichment_worker.client.reload_config()
add_activity_item("", "Spotify Auth Complete", "Successfully authenticated with Spotify", "Now")
self.send_response(200)
self.send_header('Content-type', 'text/html')

View file

@ -40211,14 +40211,14 @@ function updateSpotifyEnrichmentStatusFromData(data) {
const notAuthenticated = data.authenticated === false;
button.classList.remove('active', 'paused', 'complete', 'no-auth');
if (notAuthenticated) {
if (data.paused) {
button.classList.add('paused');
} else if (notAuthenticated) {
button.classList.add('no-auth');
} else if (data.idle) {
button.classList.add('complete');
} else if (data.running && !data.paused) {
button.classList.add('active');
} else if (data.paused) {
button.classList.add('paused');
}
const tooltipStatus = document.getElementById('spotify-enrich-tooltip-status');
@ -40226,15 +40226,17 @@ function updateSpotifyEnrichmentStatusFromData(data) {
const tooltipProgress = document.getElementById('spotify-enrich-tooltip-progress');
if (tooltipStatus) {
if (notAuthenticated) { tooltipStatus.textContent = 'Not Authenticated'; }
if (data.paused) { tooltipStatus.textContent = 'Paused'; }
else if (notAuthenticated) { tooltipStatus.textContent = 'Not Authenticated'; }
else if (data.idle) { tooltipStatus.textContent = 'Complete'; }
else if (data.running && !data.paused) { tooltipStatus.textContent = 'Running'; }
else if (data.paused) { tooltipStatus.textContent = 'Paused'; }
else if (data.running) { tooltipStatus.textContent = 'Running'; }
else { tooltipStatus.textContent = 'Idle'; }
}
if (tooltipCurrent) {
if (notAuthenticated) {
if (data.paused) {
tooltipCurrent.textContent = notAuthenticated ? 'Connect Spotify in Settings to enrich' : 'Click to resume';
} else if (notAuthenticated) {
tooltipCurrent.textContent = 'Connect Spotify in Settings to enrich';
} else if (data.idle) {
tooltipCurrent.textContent = 'All items processed';