Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Hidara1904 opened this issue Aug 4, 2024 · 1 comment

Comments

@Hidara1904
Copy link

Hidara1904 commented Aug 4, 2024

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.

@ZeroQI
Copy link
Owner

ZeroQI commented Nov 11, 2024

orig_title: 'Re Zero kara Hajimeru Isekai Seikatsu (2018)', orig_title_cleansed: 're zero kara hajimeru isekai seikatsu'
[-] score: 98, aid: 11370, title: "Re:Zero kara Hajimeru Isekai Seikatsu"
[-] score: 98, aid: 13430, title: "Re:Zero kara Hajimeru Isekai Seikatsu (2018)"

http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=13430

<titles>
<title xml:lang="x-jat" type="main">Re:Zero kara Hajimeru Isekai Seikatsu (2018)</title>
<title xml:lang="en" type="synonym">Re:ZERO -Starting Life in Another World- OVAs</title>
<title xml:lang="ru" type="synonym">Re: Жизнь в другом мире с нуля - Снежные воспоминания</title>
<title xml:lang="ko" type="synonym">Re: 제로부터 시작하는 이세계 생활 (2018)</title>
<title xml:lang="x-jat" type="short">rezero movie</title>
<title xml:lang="x-jat" type="short">re:zero ova</title>
<title xml:lang="ja" type="official">Re:ゼロから始める異世界生活 (2018)</title>
<title xml:lang="en" type="official">Re:Zero - Starting Life in Another World (2018)</title>
<title xml:lang="de" type="official">Re:ZERO -Starting Life in Another World- OVAs</title>
<title xml:lang="ru" type="official">Re:Zero — жизнь с нуля в другом мире OVA</title>
<title xml:lang="zh-Hant" type="official">Re:從零開始的異世界生活 OVA</title>
</titles>

Please have root/Grouping folder/Series folder:

  • Re:Zero kara Hajimeru Isekai Seikatsu / Re:Zero kara Hajimeru Isekai Seikatsu [anidb-11370]
  • Re:Zero kara Hajimeru Isekai Seikatsu / Re:Zero kara Hajimeru Isekai Seikatsu (2018) [anidb-13430]

For the screen capture:

  • You did create a series folder and put it in the root
  • You did create a subfolder inside and try to make it a different series...
  • The scanner would group that in the id used by the root folder
  • I did create a grouping folder functionality to support series folder inside a folder at root, but it is a hack and will rescan the files at every scan, it will not be cached, but you did an unsupported mix...

It might not change much here though, the agent handles years ok as long as the title doesn't have a weird character like semicolon preventing the 100% match. I would use the forced ID in the sequel there to be fair...

I am not sure if no space instead of a space when replacing the semicolon makes a difference

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

No branches or pull requests

2 participants