diff --git a/tests/test_video_side_shell.py b/tests/test_video_side_shell.py index 14415a80..2725751b 100644 --- a/tests/test_video_side_shell.py +++ b/tests/test_video_side_shell.py @@ -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(): diff --git a/webui/index.html b/webui/index.html index cd9845a8..372285af 100644 --- a/webui/index.html +++ b/webui/index.html @@ -4807,12 +4807,8 @@ - Which server libraries the video side scans (doesn't affect config file) + Which libraries the video side scans. -
- - -
diff --git a/webui/static/video/video-settings.js b/webui/static/video/video-settings.js index 24b041cc..6530483e 100644 --- a/webui/static/video/video-settings.js +++ b/webui/static/video/video-settings.js @@ -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); }