fix(jellyfin): scope global search to visible libraries

Jellyfin search rows do not expose their owning collection, so hidden libraries cannot be filtered after the response. Scope searches to visible libraries, stamp the returned rows, reuse the latest loaded views, propagate cancellation, and fail closed when views cannot be loaded.

Keep full candidate budgets and split music libraries into parallel album, audio, and artist requests. Album requests disable UserData and use the existing album field set to avoid recursive per-album work from #1552; audio requests retain cheap leaf play state.

close #1770
This commit is contained in:
edde746
2026-08-02 09:29:59 +02:00
parent 1d9ffb7427
commit 35061f9f68
7 changed files with 689 additions and 12 deletions
+9 -1
View File
@@ -3607,8 +3607,16 @@ class PlexClient
return getFirstCharacters(libraryId, filters: filters);
}
/// [excludedLibraryIds] is unused: `/library/search` has no section-scoping
/// parameter, and every row carries its `librarySectionID`, so the caller
/// filters hidden libraries out of the mapped results.
@override
Future<List<MediaItem>> searchItems(String query, {int limit = 100, AbortController? abort}) async {
Future<List<MediaItem>> searchItems(
String query, {
int limit = 100,
AbortController? abort,
Set<String> excludedLibraryIds = const {},
}) async {
final results = await _search(query, limit: limit, abort: abort);
return results.map((m) => PlexMappers.mediaItem(m)).toList();
}