Skip to content

fix: fall back to tmdb/tvdb/kitsu ids for imdb-less custom art#569

Open
IbbyLabs wants to merge 1 commit into
cedya77:devfrom
IbbyLabs:fix/thumbnail-art-id-fallback
Open

fix: fall back to tmdb/tvdb/kitsu ids for imdb-less custom art#569
IbbyLabs wants to merge 1 commit into
cedya77:devfrom
IbbyLabs:fix/thumbnail-art-id-fallback

Conversation

@IbbyLabs

Copy link
Copy Markdown
Contributor

Summary

Custom art patterns that reference {imdb_id} (e.g. an episode thumbnail pattern like /thumbnail/{imdb_id}/S{season}E{episode}.jpg) resolve to nothing when the title has no IMDb ID, which is common for anime resolved via TVDB or Kitsu. The resolver returned null and the image rendered blank even though the art service can serve the episode by another ID. This adds an ID fallback: when {imdb_id} is unavailable, retry with an available ID in a form these services accept in the same path slot (tmdb:{type}:{id}, tvdb:{id}, kitsu:{id}).

Linked issue

Closes #568

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Tests only
  • Documentation only
  • CI / tooling

Why this approach

It mirrors the existing RPDB/TOP id-fallback (resolveRatingPosterUrl), but for self-hosted art services that key by path segment. The fallback is gated on {imdb_id} appearing in the URL path (before ?), so a composite id like tmdb:series:123 is only injected where it's a valid path segment and never corrupts a ?imdb_id= query parameter used by other art providers. When no usable id exists it still returns null, preserving the current behaviour of keeping the meta-provided image. It reuses resolvePattern rather than duplicating substitution logic.

Testing

  • I ran existing tests relevant to this change.
  • I added or updated tests where needed.
  • No tests were needed, and I explained why.

Verified the resolver output for the imdb-present, anime (kitsu/tvdb/tmdb only), no-id, and query-param (?imdb_id=) cases: anime now resolves to kitsu:/tvdb:/tmdb:series: forms, imdb-present is unchanged, no-id returns null, and query-param patterns are left untouched. Confirmed end to end that the produced URLs return HTTP 200 images from the live art service for kitsu/tvdb/tmdb ids. node --check passes. There is no existing test harness around this resolver to extend.

Documentation

  • I updated documentation or comments where needed.
  • No documentation updates were needed.

Author checklist

  • This PR is focused on one concern.
  • This PR is reasonably small and reviewable.
  • I read and followed CONTRIBUTING.md.
  • I can explain every code change in this PR.
  • I will respond to review feedback myself.

AI usage disclosure

  • No AI tools were used.
  • AI tools were used for part of this PR, and I personally reviewed and verified all changes.

If AI tools were used, briefly describe how: used to trace the resolver path and verify the fallback output across id cases and against the live art service; all changes were reviewed and verified.

Custom art patterns that reference {imdb_id} (e.g. an episode thumbnail
pattern like /thumbnail/{imdb_id}/S{season}E{episode}.jpg) resolve to
nothing when the title has no IMDb ID, which is common for anime resolved
via TVDB or Kitsu. The resolver returned null and the image rendered blank
even though the art service can serve the episode by another ID.

Retry with an available ID in a form these services accept in the same
path slot: tmdb:{type}:{id}, tvdb:{id}, kitsu:{id}. Gated on {imdb_id}
appearing in the URL path, so a composite ID never corrupts a
'?imdb_id=' query parameter used by other art providers.
@github-actions

Copy link
Copy Markdown
Contributor

PR Guard

  • All automated intake checks passed.

Maintainers may still close PRs that do not match project direction or review capacity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom art patterns using {imdb_id} render blank for anime without an IMDb ID

1 participant