Fix chromaprint crash on surround audio and Spotify worker status display
This commit is contained in:
parent
548b5cfbdf
commit
2d6c55e294
3 changed files with 21 additions and 10 deletions
|
|
@ -124,9 +124,12 @@ class SpotifyWorker:
|
||||||
|
|
||||||
# Auth guard — don't process anything without Spotify auth
|
# Auth guard — don't process anything without Spotify auth
|
||||||
if not self.client.is_spotify_authenticated():
|
if not self.client.is_spotify_authenticated():
|
||||||
logger.debug("Spotify not authenticated, sleeping 30s...")
|
# Try reloading config in case user re-authenticated via settings
|
||||||
time.sleep(30)
|
self.client.reload_config()
|
||||||
continue
|
if not self.client.is_spotify_authenticated():
|
||||||
|
logger.debug("Spotify not authenticated, sleeping 30s...")
|
||||||
|
time.sleep(30)
|
||||||
|
continue
|
||||||
|
|
||||||
self.current_item = None
|
self.current_item = None
|
||||||
item = self._get_next_item()
|
item = self._get_next_item()
|
||||||
|
|
|
||||||
|
|
@ -3685,6 +3685,9 @@ def spotify_callback():
|
||||||
if spotify_client.is_authenticated():
|
if spotify_client.is_authenticated():
|
||||||
# Invalidate status cache so next poll picks up the new connection
|
# Invalidate status cache so next poll picks up the new connection
|
||||||
_status_cache_timestamps['spotify'] = 0
|
_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")
|
add_activity_item("✅", "Spotify Auth Complete", "Successfully authenticated with Spotify", "Now")
|
||||||
return "<h1>Spotify Authentication Successful!</h1><p>You can close this window.</p>"
|
return "<h1>Spotify Authentication Successful!</h1><p>You can close this window.</p>"
|
||||||
else:
|
else:
|
||||||
|
|
@ -28322,6 +28325,9 @@ def start_oauth_callback_servers():
|
||||||
if spotify_client.is_authenticated():
|
if spotify_client.is_authenticated():
|
||||||
# Invalidate status cache so next poll picks up the new connection
|
# Invalidate status cache so next poll picks up the new connection
|
||||||
_status_cache_timestamps['spotify'] = 0
|
_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")
|
add_activity_item("✅", "Spotify Auth Complete", "Successfully authenticated with Spotify", "Now")
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
self.send_header('Content-type', 'text/html')
|
self.send_header('Content-type', 'text/html')
|
||||||
|
|
|
||||||
|
|
@ -40211,14 +40211,14 @@ function updateSpotifyEnrichmentStatusFromData(data) {
|
||||||
const notAuthenticated = data.authenticated === false;
|
const notAuthenticated = data.authenticated === false;
|
||||||
|
|
||||||
button.classList.remove('active', 'paused', 'complete', 'no-auth');
|
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');
|
button.classList.add('no-auth');
|
||||||
} else if (data.idle) {
|
} else if (data.idle) {
|
||||||
button.classList.add('complete');
|
button.classList.add('complete');
|
||||||
} else if (data.running && !data.paused) {
|
} else if (data.running && !data.paused) {
|
||||||
button.classList.add('active');
|
button.classList.add('active');
|
||||||
} else if (data.paused) {
|
|
||||||
button.classList.add('paused');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const tooltipStatus = document.getElementById('spotify-enrich-tooltip-status');
|
const tooltipStatus = document.getElementById('spotify-enrich-tooltip-status');
|
||||||
|
|
@ -40226,15 +40226,17 @@ function updateSpotifyEnrichmentStatusFromData(data) {
|
||||||
const tooltipProgress = document.getElementById('spotify-enrich-tooltip-progress');
|
const tooltipProgress = document.getElementById('spotify-enrich-tooltip-progress');
|
||||||
|
|
||||||
if (tooltipStatus) {
|
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.idle) { tooltipStatus.textContent = 'Complete'; }
|
||||||
else if (data.running && !data.paused) { tooltipStatus.textContent = 'Running'; }
|
else if (data.running) { tooltipStatus.textContent = 'Running'; }
|
||||||
else if (data.paused) { tooltipStatus.textContent = 'Paused'; }
|
|
||||||
else { tooltipStatus.textContent = 'Idle'; }
|
else { tooltipStatus.textContent = 'Idle'; }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tooltipCurrent) {
|
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';
|
tooltipCurrent.textContent = 'Connect Spotify in Settings to enrich';
|
||||||
} else if (data.idle) {
|
} else if (data.idle) {
|
||||||
tooltipCurrent.textContent = 'All items processed';
|
tooltipCurrent.textContent = 'All items processed';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue