Skip to content

Size IMDb chart posters for the clients instead of sending the originals - #323

Closed
mike-echo-oscar-whiskey wants to merge 1 commit into
Moonfin-Client:masterfrom
mike-echo-oscar-whiskey:imdb-poster-size
Closed

mike-echo-oscar-whiskey wants to merge 1 commit into
Moonfin-Client:masterfrom
mike-echo-oscar-whiskey:imdb-poster-size

Conversation

@mike-echo-oscar-whiskey

@mike-echo-oscar-whiskey mike-echo-oscar-whiskey commented Oct 13, 2026 •

Copy link
Copy Markdown

Pull Request

Summary

The IMDb chart rows hand clients the poster URL exactly as IMDb's GraphQL names it, which is the full-size original: 1200 to 1400 pixels wide and anywhere from 100 KB to 4 MB per title. Every other external row gives a client a 342 or 500 pixel TMDB poster. A Top 250 row is up to 250 of those originals, and the Tizen and Roku clients put the URL straight into an image tag with no resize.

The image host sizes a poster on request through the transform block before the extension (._V1_.jpg is the original, ._V1_UX500_.jpg the 500 pixel wide variant), so the sync task now stores the 500 pixel variant. The Top 250 poster that was 4.2 MB at 1383x2048 comes back as 75 KB at 500x740. Width 500 matches the TMDB w500 the clients already use for an external poster on the details page.

Related Issues

None open. Found while chasing blank IMDb rows on Moonfin for Tizen 2.10.0, which turned out to be the client sending the Amazon URL to image.tmdb.org (fixed on Smart-TV master in 1c31b5ad, after 2.10.0). This change is the server-side half: it does not fix 2.10.0, it keeps the rows from shipping 4 MB posters once the client loads them.

Type of Change

  • Bug fix

Area

  • Custom home rows

Changes Made

  • Jellyfin/backend/Services/ImdbListsTask.cs: SizedPosterUrl rewrites the transform block of an IMDb image URL to UX500; a URL without the block (or already transformed) is left as it is. Applied where the chart's primaryImage.url is read.
  • Emby/Emby.Plugins.Moonfin/Services/ImdbChartFetcher.cs: the same, so both ports hand out the same URL.
  • Tests for the rewrite in both test projects (ImdbChartPosterTests).

Titles cached before this keep the original URL until the next sync, which runs at startup and daily, so an upgrade fixes itself on the restart that installs it.

Client Impact

  • No client changes needed

Compatibility

  • Change to the settings profile is additive only, no renamed or removed properties (no settings touched)
  • Older clients still work, unknown fields are ignored and no keys were removed

Testing

  • Built the plugin and deployed to a Jellyfin server (Jellyfin 12.2.0, the 2.4.0 source with this patch applied)
  • Verified against a live client (which one: not on screen. Moonfin for Tizen 2.10.0 cannot show these rows for the client-side reason above, so the check here was the row endpoint and the sized URLs fetching; I will confirm on a TV once the client fix ships)
  • Manual testing completed on the server side

Test Steps

  1. dotnet test on both test projects: 478 and 320 passed, including the three new ones; the salvage tool passes.
  2. Installed the built Moonfin.Server.dll on Jellyfin 12.2.0 and restarted. The startup sync fetched all six charts; imdb_lists_cache.json holds 1050 poster URLs, all 1050 with _V1_UX500_.
  3. GET /Moonfin/CustomRows/Items?source=imdb&type=imdb_top_250_movies returns 250 items with the sized URLs; the first three fetch with HTTP 200 at 500x740 and 500x750.

Screenshots (if applicable)

The same Top 250 poster as the task stored it before and as it stores it now. Both are the live files on IMDb's image host.

Before: ._V1_.jpg, 1200x1800, 334 KB After: ._V1_UX500_.jpg, 500x750, 68 KB
The Shawshank Redemption poster, original size The Shawshank Redemption poster, 500 pixels wide

Before: https://m.media-amazon.com/images/M/MV5BMDAyY2FhYjctNDc5OS00MDNlLThiMGUtY2UxYWVkNGY2ZjljXkEyXkFqcGc@._V1_.jpg
After: https://m.media-amazon.com/images/M/MV5BMDAyY2FhYjctNDc5OS00MDNlLThiMGUtY2UxYWVkNGY2ZjljXkEyXkFqcGc@._V1_UX500_.jpg

Checklist

  • Code builds successfully
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced
  • Any new setting keys match the client-side keys exactly (none added)

IMDb's GraphQL names the full-size poster, 1200 to 1400 pixels wide and
between 100 KB and 4 MB each, and the charts handed that URL to the
clients as it was, where every other external row gives a client a 342
or 500 pixel TMDB poster. The image host sizes a poster through the
transform block before the extension, so the task now stores the 500
pixel variant, about 75 KB. Same change on the Emby port. Titles cached
before this keep the original until the next sync, which runs at
startup.
@github-actions github-actions Bot added Bug Something isn't working Home Rows labels Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Moonfin-Client/Plugin/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 811b745e-a351-4526-aa45-02c1e56b94fb
📥 Commits

Reviewing files that changed from the base of the PR and between 2eda02b and d083c53.

📒 Files selected for processing (4)
  • Emby/Emby.Plugins.Moonfin/Services/ImdbChartFetcher.cs
  • Emby/tests/Emby.Plugins.Moonfin.Tests/ImdbChartPosterTests.cs
  • Jellyfin/backend/Services/ImdbListsTask.cs
  • Jellyfin/tests/Moonfin.Server.Tests/ImdbChartPosterTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Improvements
    • IMDb chart posters are now requested at a consistent 500-pixel width where supported.
    • Poster URLs without a compatible IMDb image transform remain unchanged.

The Emby and Jellyfin chart fetchers now add IMDb’s UX500 transform to matching poster URLs. Tests cover transformed URLs and inputs that remain unchanged.

Changes: IMDb chart poster sizing

Layer / File(s) Summary
Poster URL sizing and chart integration
Emby/Emby.Plugins.Moonfin/Services/ImdbChartFetcher.cs, Jellyfin/backend/Services/ImdbListsTask.cs, Emby/tests/Emby.Plugins.Moonfin.Tests/ImdbChartPosterTests.cs, Jellyfin/tests/Moonfin.Server.Tests/ImdbChartPosterTests.cs
Both chart fetchers apply UX500 to matching IMDb poster URLs. Tests check the transformed URL and confirm that unmatched, already-sized, null, and empty inputs remain unchanged.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: radicalmuffinman

Merge Risk: ⚪ Minimal · up to d083c

The change consistently requests sized posters in both integrations, with focused tests; no concrete merge-blocking risk is established.

Security architecture risk: ⚪ Minimal · up to d083c

This is a narrow poster-sizing change. Existing chart access controls, data formats, and cache ownership remain intact. No material security risk introduced or worsened by this PR was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed values propagate to existing IMDb chart consumers through shared per-chart caches and direct row responses. This expands neither the set of callers nor service privileges; exposure remains bounded to the existing poster-data flow.

Trust Boundaries and Controls

  • observed — Caller-supplied chart keys remain constrained by the fixed map before the GraphQL request. Inspected custom-row entrypoints retain authentication and per-user rating filtering, and scheduled sync retains its configuration gate. The poster rewrite does not bypass those controls.

Resilience and Maintainability Implications

  • inferred — The rewrite occurs before existing cache publication and adds no reservation, resource ownership, or cleanup state. Inspected failure, cancellation, concurrent refresh, persistence, and recovery behavior is unchanged. Existing file-write atomicity and task exception-handling limitations therefore do not constitute introduced or worsened PR concerns.
Pre-merge checks · Passed 4
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description covers the required sections, explains the server and client impact, lists the implementation changes, documents testing, and completes the checklist. Live-client verification is expli…
Title check Passed The title clearly and concisely describes the primary change: serving sized IMDb chart posters instead of original images.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@RadicalMuffinMan

Copy link
Copy Markdown
Contributor

Your AI didnt attach the images correctly

@mike-echo-oscar-whiskey

Copy link
Copy Markdown
Author

Sorry about that, the links were in code spans so nothing rendered. My AI has attached the images now: the same poster before and after, straight from IMDb's image host, in the Screenshots section.

@mike-echo-oscar-whiskey

Copy link
Copy Markdown
Author

Closing this one and reopening #321 for the same branch, as asked; the images and the rewritten commit are there.

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

Labels

Bug Something isn't working Home Rows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants