video settings: library mapping saves on change (match music), drop button

The Movies/TV selectors now save the moment you pick one — same as the music
'Music Library' selector right above them — instead of a separate 'Save
Libraries' button. Removed the button and the copied 'doesn't affect config
file' caption; a small inline status shows 'Saved'.
This commit is contained in:
BoulderBadgeDad 2026-06-14 00:29:53 -07:00
parent 576199bb2f
commit 41f6558c2d
3 changed files with 8 additions and 8 deletions

View file

@ -200,7 +200,6 @@ def test_video_library_mapping_ui_present_and_video_only():
# data-video-only so they show only on the video side.
assert 'data-video-lib-select="movies"' in _INDEX
assert 'data-video-lib-select="tv"' in _INDEX
assert "data-video-lib-save" in _INDEX
assert "data-video-only" in _INDEX
css = _CSS_PATH.read_text(encoding="utf-8")
assert 'body[data-side="music"] [data-video-only]' in css # hidden on music side
@ -215,6 +214,7 @@ def test_video_settings_module_referenced_and_isolated():
assert "addEventListener" in _VSETTINGS_JS
assert "/api/video/libraries" in _VSETTINGS_JS
assert "soulsync:video-page-shown" in _VSETTINGS_JS
assert "'change'" in _VSETTINGS_JS # saves on change, like the music selector
def test_controller_is_isolated_iife_with_no_globals():

View file

@ -4807,12 +4807,8 @@
<option value="">Loading...</option>
</select>
<small style="color: #999; font-size: 0.9em; display: block; margin-top: 5px;">
Which server libraries the video side scans (doesn't affect config file)
Which libraries the video side scans. <span data-video-lib-status></span>
</small>
<div style="margin-top: 8px;">
<button type="button" class="detect-button" data-video-lib-save>Save Libraries</button>
<span data-video-lib-status style="margin-left: 10px; font-size: 0.9em; color: #999;"></span>
</div>
</div>
<div class="form-actions">
<button id="plex-config-action-button" class="detect-button" onclick="clearPlexConfiguration()">Clear Configuration</button>

View file

@ -67,8 +67,12 @@
}
function init() {
var btn = document.querySelector('[data-video-lib-save]');
if (btn) btn.addEventListener('click', save);
// Save the moment a library is picked — same behaviour as the music
// 'Music Library' selector above (which saves on change, no button).
var selects = document.querySelectorAll('[data-video-lib-select]');
for (var i = 0; i < selects.length; i++) {
selects[i].addEventListener('change', save);
}
document.addEventListener('soulsync:video-page-shown', onPageShown);
}