Skip to content

fix(web): resolve home server catalog titles loading issue - #493

Merged
ProdigyV21 merged 2 commits into
ProdigyV21:mainfrom
Himanth-reddy:fix/web-homeserver-catalog-titles
Jul 28, 2026
Merged

fix(web): resolve home server catalog titles loading issue#493
ProdigyV21 merged 2 commits into
ProdigyV21:mainfrom
Himanth-reddy:fix/web-homeserver-catalog-titles

Conversation

@Himanth-reddy

Copy link
Copy Markdown
Collaborator

Summary

Fixes a bug in the web application where connecting a Home Server (Jellyfin, Emby, Plex) results in empty catalogs with no titles displayed.

Root Causes & Fixes

  1. Jellyfin API Query Field Truncation (web/lib/homeserver.ts):

    • Jellyfin items request previously used Fields=Overview, which caused Jellyfin/Emby servers to omit optional fields such as ImageTags, BackdropImageTags, PrimaryImageTag, ProductionYear, and CommunityRating.
    • Updated request to include Fields=Overview,PrimaryImageAspectRatio,BasicSyncInfo,ImageTags,BackdropImageTags,ProductionYear,CommunityRating.
  2. Session Authentication Fallback (web/lib/homeserver.ts):

    • ensureSession() now immediately returns { token, userId } when both are present on the config.
    • Added fallback logic with api_key=${encodeURIComponent(server.token)} parameter for /Users/Me and /Users endpoints.
  3. Collection Type Matching (web/lib/homeserver.ts):

    • Replaced strict string matching v.CollectionType === "movies" || v.CollectionType === "tvshows" with isVideoCollectionType() to prevent libraries with non-standard collection type descriptors (or missing descriptors) from being dropped.
  4. Home Server Catalog Source Support (web/lib/tmdb.ts & web/lib/store.tsx):

    • Added support for catalog.sourceType === "home-server" in loadCatalog() and HOME_SERVER collection sources in loadCollectionSource().
    • Passed homeServers through loadCatalogRow() in store.tsx.
  5. Item Mapping & Filtering (web/lib/homeserver.ts):

    • Updated mapItem() to check both item.ImageTags?.Primary and item.PrimaryImageTag.
    • Filter items using Boolean(m && m.title) so items without pre-cached artwork remain visible in catalog rails.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6c7994f1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/lib/store.tsx
}, []);

const loadCatalogRow = useCallback((catalog: CatalogConfig) => loadCatalog(catalog, settings.language, addonsRef.current), [settings.language]);
const loadCatalogRow = useCallback((catalog: CatalogConfig) => loadCatalog(catalog, settings.language, addonsRef.current, settingsRef.current.homeServers), [settings.language]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Invalidate catalog rows when home servers change

For home-server catalogs this loader now depends on settingsRef.current.homeServers, but the only caller I checked (LazyRail) still keys its 12-hour catalog cache and reload effect from the catalog/language fields, not the active profile or home-server list. When a user switches profiles or removes/replaces a server while a home-server catalog has the same id/sourceUrl, the rail can keep rendering the previous server's cached personal library instead of reloading against the new homeServers; include a home-server/profile version in that cache key or bypass the cache for these rows.

Useful? React with 👍 / 👎.

@Himanth-reddy
Himanth-reddy force-pushed the fix/web-homeserver-catalog-titles branch from 15341e7 to e6c7994 Compare July 28, 2026 06:40
fix(web): keep the placeholder for home server items without artwork

Building an image URL unconditionally meant every Jellyfin item got a
non-empty `image`, including ones the server has no artwork for. Combined
with the loosened visibility filter those items reached the rails pointing
at an image route that 404s.

MediaCard renders a Clapperboard placeholder for an empty value but a
broken <img> for a failing URL, and it skips the TMDB artwork back-fill
for home-server items, so nothing recovers it. Fall back to empty instead;
the items stay visible, which is the point of the filter change, and show
the placeholder rather than a broken thumbnail. Plex already did this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@
@ProdigyV21
ProdigyV21 merged commit 2377ed7 into ProdigyV21:main Jul 28, 2026
4 checks passed
@Himanth-reddy Himanth-reddy added gssoc:approved GSSoC approved contribution level:intermediate Intermediate level task quality:clean Clean code implementation type:bug Bug fix type:design UI/UX design enhancements labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC approved contribution level:intermediate Intermediate level task quality:clean Clean code implementation type:bug Bug fix type:design UI/UX design enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants