diff --git a/jellyfin-plugin/Jellyfin.Plugin.SceneSearch/Configuration/configPage.html b/jellyfin-plugin/Jellyfin.Plugin.SceneSearch/Configuration/configPage.html
index aaed910..3af5afc 100644
--- a/jellyfin-plugin/Jellyfin.Plugin.SceneSearch/Configuration/configPage.html
+++ b/jellyfin-plugin/Jellyfin.Plugin.SceneSearch/Configuration/configPage.html
@@ -46,13 +46,16 @@
Indexed Libraries
- 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.
+ Choose which Jellyfin libraries Scene Search should keep indexed. Apply selection only removes deselected libraries directly from Scene Search SQLite and Meilisearch without rebuilding the full Meilisearch index. Selection is stored in this plugin, not in the Python .env file.
Loading libraries…
+
+ Apply selection only
+
- Apply library selection / index
+ Index selected libraries
@@ -367,6 +370,45 @@
}
});
+ page.querySelector('#applyLibraries').addEventListener('click', function () {
+ var ids = selectedLibraryIds();
+ 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 = 'Applying library selection...';
+
+ ApiClient.getPluginConfiguration(pluginId).then(function (config) {
+ config.SelectedLibraryIds = ids;
+ currentConfig = config;
+ return ApiClient.updatePluginConfiguration(pluginId, config);
+ }).then(function () {
+ return ApiClient.ajax({
+ type: 'POST',
+ url: ApiClient.getUrl('Plugins/SceneSearch/LibrarySelection'),
+ contentType: 'application/json',
+ data: JSON.stringify({
+ library_ids: ids,
+ force: false
+ })
+ });
+ }).then(function (result) {
+ var removedLibraries = Number(result.removed_libraries || 0);
+ var removedMedia = Number(result.removed_media || 0);
+ page.querySelector('#indexStatus').textContent = removedLibraries
+ ? 'Selection applied: removed ' + removedLibraries +
+ ' librar' + (removedLibraries === 1 ? 'y' : 'ies') +
+ ' and ' + removedMedia + ' media items. No full search-index rebuild.'
+ : 'Selection applied: nothing to remove.';
+ loadLibraries();
+ }).catch(function () {
+ page.querySelector('#indexStatus').textContent =
+ 'Could not apply library selection. Check Jellyfin logs and Scene Search API status.';
+ });
+ });
+
page.querySelector('#indexNow').addEventListener('click', function () {
var ids = selectedLibraryIds();
if (!ids.length && !window.confirm(