Skip to content

Naming Scheme "Show Title (year)" (according to Anidb) is not being recognized properly #575

@Hidara1904

Description

@Hidara1904

LOGS

Re:Zero kara Hajimaru Isekai Seikatsu (2018)
Re Zero kara Hajimeru Isekai Seikatsu (2018).filelist.log
Re Zero kara Hajimeru Isekai Seikatsu (2018).scanner.log
Re Zero kara Hajimeru Isekai Seikatsu (2018).agent-update.log
Re Zero kara Hajimeru Isekai Seikatsu (2018).agent-search.log
Re:Zero kara Hajimaru Isekai Seikatsu (2020)
Re Zero kara Hajimeru Isekai Seikatsu (2020).scanner.log
Re Zero kara Hajimeru Isekai Seikatsu (2020).filelist.log
Re Zero kara Hajimeru Isekai Seikatsu (2020).agent-update.log
Re Zero kara Hajimeru Isekai Seikatsu (2020).agent-search.log
Re:Zero kara Hajimaru Isekai Seikatsu (2021)
Re Zero kara Hajimeru Isekai Seikatsu (2021).filelist.log
Re Zero kara Hajimeru Isekai Seikatsu (2021).scanner.log
Re Zero kara Hajimeru Isekai Seikatsu (2021).agent-search.log
*.agent-update.log is not created for this

Note:.agent-update.log is sometimes created and sometimes not. Mostly not.

First of all I'll say, I just posted an issue before this. #574 . This may or may not be related to that issue.

Summary:

Anime Title (year) is not being given the correct anidb-id. Many animes on AniDB have titles with year. It is usually with titles that have two parts for a single season. This issue does not occur with animes that get a 100% score (meaning if they satisfy the condition if orig_title == title in the search function in AniDB.py). For Example:

  • Akagami no Shirayuki-hime (2016)
  • Boku no Hero Academia (2018)

This only happens if the title has to go through the "keyword search". Specifically if they go through cleanse_title(string) function in common.py. For Example:

  • Dr.Stone: New World (2023)
  • Shingeki no Kyojin: The Final Season (2022)
  • Sword Art Online: Alicization - War of Underworld (2020)

Reasons:

This is happening because in the cleanse_title(string) function, the (year) gets stripped from the title. And then the cleansed title is left with "shingeki no kyojin the final season". Then both the first part and the second part get a 98 score. And the last anidb entry is chosen which is "Shingeki no Kyojin: The Final Season (2022)".
Image:
Capture
As you can tell, the two parts got merged together in the same show.

My Temporary Solution

I managed to solve this by changing the regex in the common.py (local copy) cleanse_title(string) for replacing the parentheses with ' '.
Before:
while re.search(r'\([^\(\)]*?\)', string): string = re.sub(r'\([^\(\)]*?\)', ' ', string)
After:
while re.search(r'\([^\(\)]{5,}\)', string): string = re.sub(r'\([^\(\)]{5,}\)', ' ', string)
So it only replaces it with a ' ', if there are more than 4 characters in the parentheses. Now I know this is not a good solution to the problem, but I'm don't know python and did not want to risk writing a new function.

NOTE

I noticed a year variable in the code files. I would assume that the variable was there to check for the year. Was that supposed to trigger for TV shows as well? Or is it just supposed to be for movies. Because it is not showing anything for me.

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