From 1d9d399a2f79a8e59877195c2706686136507820 Mon Sep 17 00:00:00 2001 From: Antti Kettunen Date: Sat, 2 May 2026 10:17:05 +0300 Subject: [PATCH] Fix dashboard metadata source testing - Point the dashboard Test Connection button at the active metadata source instead of hardcoded Spotify. - Populate the response line from the current status payload so the card no longer stays at Response: --. - Keep the existing Spotify-specific auth handling when Spotify is the configured source. --- webui/index.html | 2 +- webui/static/core.js | 4 ++++ webui/static/shared-helpers.js | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/webui/index.html b/webui/index.html index 1b9c2694..4e5d3afc 100644 --- a/webui/index.html +++ b/webui/index.html @@ -626,7 +626,7 @@

Response: --

diff --git a/webui/static/core.js b/webui/static/core.js index 3a23cb53..4e3b6ad8 100644 --- a/webui/static/core.js +++ b/webui/static/core.js @@ -885,4 +885,8 @@ const API = { let _lastServiceStatus = null; let _isSoulsyncStandalone = false; // Global flag: true when no media server (sync buttons hidden) +function getActiveMetadataSource() { + return _lastServiceStatus?.spotify?.source || 'spotify'; +} + // =============================== diff --git a/webui/static/shared-helpers.js b/webui/static/shared-helpers.js index 6fed9d88..29b2a1fa 100644 --- a/webui/static/shared-helpers.js +++ b/webui/static/shared-helpers.js @@ -3323,6 +3323,20 @@ function updateServiceStatus(service, statusData) { } syncPrimaryMetadataSourceAvailability(statusData); + + const responseTimeElement = document.getElementById('spotify-response-time'); + if (responseTimeElement) { + const responseTime = statusData.response_time; + responseTimeElement.textContent = responseTime !== undefined && responseTime !== null + ? `Response: ${responseTime}ms` + : 'Response: --'; + } + + const testButton = document.querySelector('#spotify-service-card .service-card-button'); + if (testButton) { + const source = statusData.source || 'spotify'; + testButton.setAttribute('onclick', `testDashboardConnection('${source}')`); + } } // Update download source title on dashboard card