From f93c211de3eea6688bfe24b42afe380bc120b1ad Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Mon, 15 Jun 2026 14:59:36 -0700 Subject: [PATCH] fix: video side can configure server connections again, without changing music MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous hard guard blocked saveSettings entirely on the video side — which also blocked entering/saving Plex/Jellyfin connection creds (shared, legit). Now the save runs, but on the video side it PRESERVES the persisted active_media_ server (window._persistedActiveServer) instead of reading the toggle — so video can set up a connection without ever switching the music server. Auto-save stays suppressed on the video side (no heavy music re-init from video field edits). --- webui/static/settings.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/webui/static/settings.js b/webui/static/settings.js index e4b7711f..e401526d 100644 --- a/webui/static/settings.js +++ b/webui/static/settings.js @@ -1034,6 +1034,10 @@ async function loadSettingsData() { // Set active server and toggle visibility const activeServer = settings.active_media_server || 'plex'; + // Remember the persisted music server so a save from the VIDEO side keeps + // it unchanged (the toggle there is for opening a config panel, not picking + // the music server). + window._persistedActiveServer = activeServer; toggleServer(activeServer); // Load Plex music libraries if Plex is the active server @@ -2867,11 +2871,6 @@ function _getTagConfig(path) { } async function saveSettings(quiet = false) { - // ISOLATION: this saves MUSIC settings (and persists active_media_server from - // the shared server toggle). The video side reuses this page but must never - // write music config — it saves via /api/video/* only. So never run here while - // on the video side, no matter what triggered it (auto-save OR manual). - if (document.body.getAttribute('data-side') === 'video') return; // Validate file organization templates before saving const validationErrors = validateFileOrganizationTemplates(); if (validationErrors.length > 0) { @@ -2888,6 +2887,14 @@ async function saveSettings(quiet = false) { } else if (document.getElementById('soulsync-toggle')?.classList.contains('active')) { activeServer = 'soulsync'; } + // ISOLATION: this page is reused on the video side. Connection details (Plex/ + // Jellyfin creds) ARE shared and save fine — but the video side must NEVER + // change the MUSIC active server. So when saving from the video side, keep + // active_media_server exactly as it was persisted (the toggle there only opens + // a config panel; it does not pick the music server). + if (document.body.getAttribute('data-side') === 'video' && window._persistedActiveServer) { + activeServer = window._persistedActiveServer; + } const metadataSourceSelect = document.getElementById('metadata-fallback-source'); const discogsTokenInput = document.getElementById('discogs-token');