Skip to content

Conversation

@RePacked
Copy link

⚠️ DISCLAIMER: This fix was created with the help of ChatGPT.
I am not a developer, and I have only tested it locally with the movie X (2022).
Further review and testing by maintainers is required before merging.


What

Fix Metacritic provider to try year-specific slugs first (e.g., /movie/x-2022), then fall back to plain slug, then a secondary year suffix. This avoids landing on the wrong film for ambiguous titles.

Why

Movies with shared names (e.g., X (2022)) were resolving to incorrect Metacritic pages when the URL lacked the year, causing wrong or missing ratings.

How

  • Build candidate URLs in order of likelihood:
    1. ${BASE_URL}/${mediaType}/${slug}-${year}
    2. ${BASE_URL}/${mediaType}/${slug}
    3. ${BASE_URL}/${mediaType}/${slug}-${year}-2
  • Try each until a 200 response and valid scores are found.
  • Derive year from streamInfo.year (or streamInfo.date upstream).

Impact

  • Correct Metacritic links and values for ambiguous titles.
  • Also ensures year is consistently passed through, which may indirectly improve other providers.

Testing

  • Verified locally on: X (2022) (IMDb tt13560574).
  • Maintainers should test further before merging.

Files

  • src/providers/metacritic.js (slug logic + multi-URL attempts)

…otten Tomatoes and CringeMDB ratings for the movie: X (2022)
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.

1 participant