Make plugin library selection explicitly authoritative

This commit is contained in:
Sleeps
2026-10-07 12:30:50 +01:00
parent d6cf2d7556
commit 6f056ad52a
@@ -46,13 +46,13 @@
<h2>Indexed Libraries</h2>
<div class="fieldDescription" style="margin-bottom:1em;">
Choose which Jellyfin libraries Scene Search should index. Selection is stored in this plugin, not in the Python .env file.
Choose which Jellyfin libraries Scene Search should keep indexed. Applying this selection removes deselected libraries from Scene Search SQLite and Meilisearch. Selection is stored in this plugin, not in the Python .env file.
</div>
<div id="libraryList">Loading libraries…</div>
<div style="margin-top:1em; margin-bottom:1em;">
<button is="emby-button" type="button" id="indexNow" class="raised">
<span>Index selected libraries</span>
<span>Apply library selection / index</span>
</button>
<label class="checkboxContainer" style="margin-top:1em;">
<input is="emby-checkbox" type="checkbox" id="forceIndex" />
@@ -369,12 +369,13 @@
page.querySelector('#indexNow').addEventListener('click', function () {
var ids = selectedLibraryIds();
if (!ids.length) {
page.querySelector('#indexStatus').textContent = 'Select at least one library first.';
if (!ids.length && !window.confirm(
'No libraries are selected. This will remove all Jellyfin-backed Scene Search data from SQLite and Meilisearch. Continue?'
)) {
return;
}
page.querySelector('#indexStatus').textContent = 'Saving settings and starting index…';
page.querySelector('#indexStatus').textContent = 'Saving library selection and starting index…';
ApiClient.getPluginConfiguration(pluginId).then(function (config) {
config.Enabled = page.querySelector('#enabled').checked;