fix(omdb): stop sending a series release's year to OMDb - #106
Merged
Merged
Conversation
A film's OMDb year IS its identity — "Ashfall" 1999 and "Ashfall" 2024 are different films, and y= is what tells OMDb which one — but a SERIES release's embedded year is not the same kind of fact. It is usually when the release's own season aired, not when the show debuted, and OMDb keys a series by the latter. "The Boys S05 Season 5 2026 1080p AMZN WEBRip..." parses year 2026 — the season's own air year. OMDb has no "The Boys" answering to y=2026, so the exact-match search comes back empty and falls back to an unrelated title that does happen to answer that year: wrong imdbId, wrong plot, wrong poster, on a title whose IMDb id and artwork torlink otherwise resolves correctly. Every season of a long-running or returning show carries a different embedded year, so this was not one show's edge case — it was every poster lookup for any series whose current season aired later than its debut. fetchTitleMetaByName now drops year for type: "series" before building either OMDb query it can send (the primary lookup and the episode-then-series-poster fallback). Shared by both front ends, so one change fixes it everywhere the terminal and the browser fetch title metadata by name. Found while verifying the show/season nesting work in a separate PR — "The Boys" and "The Boys S05" were both showing a poster that had nothing to do with the actual show. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011QTsg7ie21bP9JpEPFMkyP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found while visually verifying the show/season nesting work in #105 — "The Boys" and "The Boys S05" were both showing a poster that had nothing to do with the actual show, despite the app resolving the correct IMDb ID for a simplified query.
Root cause:
fetchTitleMetaByNamesends the release's parsedyearto OMDb'sy=parameter unconditionally. For a film that's correct and necessary — "Ashfall" 1999 and "Ashfall" 2024 are different films, andy=is what tells OMDb which one. But a series release's embedded year is a different kind of fact: it's usually when the release's own season aired, not when the show debuted, and OMDb keys a series by the latter.The actual release name behind this bug:
The Boys S05 Season 5 2026 1080p AMZN WEBRip AAC5.1 10bits x265-Rapta— parsesyear: 2026, the season's own air year. Verified directly against the running server:OMDb has no "The Boys" answering to
y=2026, so the exact-match search comes back empty and falls back to an unrelated title that does happen to answer that year — wrongimdbId, wrong plot, wrong poster. Every season of a long-running or returning show carries a different embedded year, so this wasn't one show's edge case — it was every poster/plot lookup for any series whose current season aired later than its debut year.Fix
fetchTitleMetaByName(src/recc/omdb.ts) now dropsyearfortype: "series"before building either OMDb query it can send — the primary lookup and the episode-then-series-poster fallback. This is shared by both front ends (the terminal calls it directly, the browser via/api/title), so one change fixes it everywhere title metadata is fetched by name.Test plan
npm test(3267 passing — updated the existing "builds a title lookup with year and type" test to a film-specific case where sending the year is still correct, and added a new test proving a series drops it)npm run typechecknpm run lint(only the known pre-existingApp.tsxwarning)npm run buildimdbIdnow resolves tott1190634(the correct show) instead of the unrelated title, and the poster shown in the app for both "The Boys" and "The Boys S05" is now correct🤖 Generated with Claude Code
https://claude.ai/code/session_011QTsg7ie21bP9JpEPFMkyP