[PR #8980] Improve TMDB matching #11931

Closed
opened 2026-02-07 06:47:04 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/jellyfin/jellyfin/pull/8980

State: closed
Merged: No


Note: This is more a proposal than a final solution

In some cases, mainly with n-ology, if the first episode is named only based on the first movie name, another of the movie can be chosen from the imdb list, even if a perfect match exists.

The current implementation takes the first result and even if tmdb should store per relevance (close match, popularity) this is not correct

The proposed solution tries to find perfect or good match for the movie instead of the first one.

Results for Foo 1

  • Foo 2
  • Foo
  • Foo 3
  • The Invincible Foo
  • ...
    Chosen Result for Foo 1: Foo

Result for Bar 3

  • Bar Snibar
  • Baroid
  • Bar
  • Bars
  • Bar³
  • Bar: CoBar
  • Bars vs Foo
  • ...
    Chosen Result for Bar 3: Bar³

Result for Un film Anglais

  • An english movie: The first episode
  • An english movie: The third episode
  • An english movie: The second episode
  • An english movie
  • After the Movie: The first episode
    ...
    Chosen Result for Un film Anglais: An english movie: The first episode (This was luck)

Result for An english movie

  • An english movie: The second episode
  • An english movie: The first episode
  • An english movie: The third episode
  • An english movie
  • After the Movie: The first episode
    ...

Chosen Result for An english movie: An english movie (This is not correct, this is the old 197x movie. But this is an exact match)

The current solution is actually not ideal and a Levenshtein distance could be a good idea here. This is juste an example.
This would also be more resilient to typos.

Some questions remains since I'm new to JellyFin

  • Is it the right place to fix this (+ namming)
  • Should this be more generic and not TMDB specific
  • Removing trailing 1 is maybe arbitrary. But 1 means is not always a relevant information when 2 has a signification
  • Should we order by date or id (mainly for "StartsWith").
  • Are their any test on this topic. Could be interesting to have some if possible.
  • If the date is not defined, a good way to mach would be to check the duration, but this info is not available on the search. This would need to perform an additional request.
**Original Pull Request:** https://github.com/jellyfin/jellyfin/pull/8980 **State:** closed **Merged:** No --- Note: This is more a proposal than a final solution In some cases, mainly with n-ology, if the first episode is named only based on the first movie name, another of the movie can be chosen from the imdb list, even if a perfect match exists. The current implementation takes the first result and even if tmdb should store per relevance (close match, popularity) this is not correct The proposed solution tries to find perfect or good match for the movie instead of the first one. Results for `Foo 1` - `Foo 2` - `Foo` - `Foo 3` - `The Invincible Foo` - ... Chosen Result for `Foo 1`: `Foo` Result for `Bar 3` - `Bar Snibar` - `Baroid` - `Bar` - `Bars` - `Bar³` - `Bar: CoBar` - `Bars vs Foo` - ... Chosen Result for `Bar 3`: `Bar³` Result for `Un film Anglais` - `An english movie: The first episode` - `An english movie: The third episode` - `An english movie: The second episode` - `An english movie` - `After the Movie: The first episode` ... Chosen Result for `Un film Anglais`: `An english movie: The first episode` (This was luck) Result for `An english movie` - `An english movie: The second episode` - `An english movie: The first episode` - `An english movie: The third episode` - `An english movie` - `After the Movie: The first episode` ... Chosen Result for `An english movie`: `An english movie` (This is not correct, this is the old 197x movie. But this is an exact match) The current solution is actually not ideal and a **Levenshtein distance** could be a good idea here. This is juste an example. This would also be more resilient to typos. Some questions remains since I'm new to JellyFin - [ ] Is it the right place to fix this (+ namming) - [ ] Should this be more generic and not TMDB specific - [ ] Removing trailing `1` is maybe arbitrary. But `1` means is not always a relevant information when 2 has a signification - [ ] Should we order by date or id (mainly for "StartsWith"). - [ ] Are their any test on this topic. Could be interesting to have some if possible. - [ ] If the date is not defined, a good way to mach would be to check the duration, but this info is not available on the search. This would need to perform an additional request.
OVERLORD added the pull-request label 2026-02-07 06:47:04 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#11931