From 11744dd3899d8c7d11e6157419c269045feaaa13 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 16 Aug 2026 09:13:28 +0200 Subject: [PATCH] fix(portals): hydrate the offline catalog and hide results while matching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `toCachedContentScope` returned null for the actor and discover routes, so an expired, inactive or offline portal skipped hydration entirely and both pages answered "not in your library" from an empty catalog even though a full imported catalog sat in SQLite. Both map to the aggregate `search` scope now — neither reads a single content type. - The results grid stayed rendered under the matching spinner. Until the matches land every card reads as unavailable, so a click during the worker request opened the portal search for a title the next tick would have resolved in another playlist. The grid is hidden while matching. Co-Authored-By: Claude Fable 5 --- .../xtream-workspace-route-session.service.ts | 9 +- .../title-results.component.html | 134 +++++++++--------- 2 files changed, 78 insertions(+), 65 deletions(-) diff --git a/libs/portal/xtream/feature/src/lib/xtream-workspace-route-session.service.ts b/libs/portal/xtream/feature/src/lib/xtream-workspace-route-session.service.ts index dcd15b41b..63247e585 100644 --- a/libs/portal/xtream/feature/src/lib/xtream-workspace-route-session.service.ts +++ b/libs/portal/xtream/feature/src/lib/xtream-workspace-route-session.service.ts @@ -92,7 +92,7 @@ function toContentInitBlockReason( } function toCachedContentScope( - section: PortalRailSection | null + section: string | null ): XtreamCachedContentScope | null { switch (section) { case 'live': @@ -101,6 +101,13 @@ function toCachedContentScope( case 'search': case 'recently-added': return section; + // Neither reads one content type: both match TMDB titles against + // the whole catalog, so they take the aggregate scope search uses. + // Without it an expired or offline portal skips hydration and the + // page answers "not in your library" from an empty catalog. + case 'actor': + case 'discover': + return 'search'; default: return null; } diff --git a/libs/ui/shared-portals/src/lib/title-results/title-results.component.html b/libs/ui/shared-portals/src/lib/title-results/title-results.component.html index 72fd642bb..89a1db829 100644 --- a/libs/ui/shared-portals/src/lib/title-results/title-results.component.html +++ b/libs/ui/shared-portals/src/lib/title-results/title-results.component.html @@ -59,69 +59,75 @@ search_off

{{ emptyMessageKey() | translate }}

+ } @else { + +
+ @for ( + item of visibleItems(); + track item.mediaType + '-' + item.tmdbId + ) { + + } +
} -
- @for ( - item of visibleItems(); - track item.mediaType + '-' + item.tmdbId - ) { - - } -