mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-19 00:03:36 +00:00
Add explicit library selection reconciliation action
This commit is contained in:
@@ -82,6 +82,30 @@ class IndexJobManager:
|
||||
)
|
||||
return result
|
||||
|
||||
def apply_library_selection(self, library_ids: list[str]) -> dict[str, object]:
|
||||
with self._state_lock:
|
||||
if self._state.get("running"):
|
||||
raise RuntimeError("A Jellyfin indexing job is already running.")
|
||||
|
||||
selected_ids = {
|
||||
str(value).strip()
|
||||
for value in library_ids
|
||||
if str(value).strip()
|
||||
}
|
||||
result = reconcile_selected_libraries(selected_ids)
|
||||
removed_ids = [
|
||||
str(value)
|
||||
for value in (result.get("removed_library_ids") or [])
|
||||
]
|
||||
if removed_ids:
|
||||
self.search_service.meili.delete_jellyfin_libraries(removed_ids)
|
||||
print(
|
||||
"Removed deselected Jellyfin libraries: "
|
||||
+ ", ".join(removed_ids)
|
||||
+ f" ({int(result.get('removed_media') or 0)} media item(s))"
|
||||
)
|
||||
return result
|
||||
|
||||
def start(self, library_ids: list[str], *, force: bool = False) -> dict[str, Any]:
|
||||
with self._state_lock:
|
||||
if self._state.get("running"):
|
||||
|
||||
Reference in New Issue
Block a user