feat(explore): match catalog items to library content via reverse external-id lookup

This commit is contained in:
edde746
2026-07-10 07:07:07 +02:00
parent 4e6ea5b4c5
commit dcdbbc8483
7 changed files with 275 additions and 0 deletions
+11
View File
@@ -488,6 +488,17 @@ abstract class MediaServerClient {
/// has no external mapping for the item.
Future<ExternalIds> fetchExternalIds(String itemId);
/// Reverse lookup: find a library movie/show matching any of [ids].
/// Both backends search by [title] (narrowed by a ±1 [year] window when
/// known, with an unfiltered fallback) and verify candidates against
/// their exact external ids — Plex against the `Guid` array (its `guid=`
/// field filter only matches the primary `plex://` guid), Jellyfin
/// against the inline `ProviderIds`. False negatives possible on
/// differing titles, false positives never. Returns null when this
/// server has no match or [kind] is not movie/show. Used to match
/// external catalog items (Explore tab) back to the user's libraries.
Future<MediaItem?> findByExternalIds(ExternalIds ids, {required MediaKind kind, String? title, int? year});
/// Chapters and intro/credits markers for [itemId]. Plex returns both in one
/// round trip; Jellyfin combines item-level chapters with best-effort native
/// media segments. Implementations may cache.