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.
This commit is contained in:
parent
5ef83cea72
commit
1d9d399a2f
3 changed files with 19 additions and 1 deletions
|
|
@ -626,7 +626,7 @@
|
|||
<p class="service-card-response-time" id="spotify-response-time">Response: --</p>
|
||||
<div class="service-card-footer">
|
||||
<button class="service-card-button"
|
||||
onclick="testDashboardConnection('spotify')">Test Connection</button>
|
||||
onclick="testDashboardConnection(getActiveMetadataSource())">Test Connection</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="service-card" id="media-server-service-card">
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
}
|
||||
|
||||
// ===============================
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue