mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-17 07:21:28 +00:00
Make posted library selection authoritative
This commit is contained in:
@@ -450,12 +450,14 @@ def _restore_frame_annotations(
|
||||
return len(matches)
|
||||
|
||||
|
||||
def reconcile_removed_libraries(client: JellyfinClient) -> dict[str, object]:
|
||||
"""Prune canonical rows whose Jellyfin library no longer exists."""
|
||||
current_ids = {
|
||||
str(library.get("Id") or "")
|
||||
for library in client.media_folders()
|
||||
if str(library.get("Id") or "")
|
||||
def reconcile_selected_libraries(
|
||||
selected_library_ids: set[str],
|
||||
) -> dict[str, object]:
|
||||
"""Make the plugin/dashboard library selection authoritative locally."""
|
||||
selected = {
|
||||
str(value).strip()
|
||||
for value in selected_library_ids
|
||||
if str(value).strip()
|
||||
}
|
||||
|
||||
removed_library_ids: list[str] = []
|
||||
@@ -474,7 +476,7 @@ def reconcile_removed_libraries(client: JellyfinClient) -> dict[str, object]:
|
||||
stale = [
|
||||
row
|
||||
for row in rows
|
||||
if str(row["jellyfin_library_id"]) not in current_ids
|
||||
if str(row["jellyfin_library_id"]) not in selected
|
||||
]
|
||||
removed_library_ids = sorted(
|
||||
{str(row["jellyfin_library_id"]) for row in stale}
|
||||
|
||||
Reference in New Issue
Block a user