Skip to content

Folder fails to lookup in tmdb because of - and : #59

Description

@jessedobbelaere

I'm retroactively scanning for missing trailers, but when a movie has a - instead of : in the folder name, the lookup in TMDB seems to fail. In many OS filesystems, a colon : cannot be used so - is added instead.

Example:

  • Folder: Chicken Run - Dawn of the Nugget (2023) parses into:
    • Title: Chicken Run - Dawn of the Nugget
    • Year: 2023
  • TMDB title: Chicken Run: Dawn of the Nugget

The TMDB API gets checked using the following snippet. A quick test to replace the special characters, makes it work with a lot of movies.

# https://github.com/jsaddiction/TrailerTech/blob/main/providers/tmdb.py#L198
        for result in response['results']:
-            if str(year) in result['release_date'] and result['title'].lower() == title.lower():
+            if str(year) in result['release_date'] and result['title'].lower().replace(":", "") == title.lower().replace(" -", ""):
                return result['id']

Ideally, we strip out special characters in this string matcher?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions