ZeroQI / Hama.bundle

Plex HTTP Anidb Metadata Agent (HAMA)
GNU General Public License v3.0
1.21k stars 113 forks source link

Issue with Re:Zero OAV #425

Closed Roguyt closed 3 years ago

Roguyt commented 3 years ago

Hi,

First and foremost thanks for your work on Hama.

I'm trying to add the Re:Zero OAV, referred as Re:Zero 2018 on Anilist (https://anidb.net/anime/13430), however they keep matching to the episode of the first season instead of the correct OAV. I've checked the scanner logs and they match to what seems to be the correct episode: s001e001 and s001e002. This is correct and accurate with anidb listings.

However the HAMA part, when it's querying the metadata seems incorrect. The agent loads the OAV metadata (s00e26 and s00e28 on tvdb) but also the Season 1 metadata.

I have updated the whole agent / scanner and also tried a plex dance & a brand-new library with no result.

Here is the relevant logs: Re Zero kara Hajimeru Isekai Seikatsu (2018).scanner.log Re Zero kara Hajimeru Isekai Seikatsu (2018).agent-update.log

Best regards

EndOfLine369 commented 3 years ago

Looks like a possible mapping issue as TVDB is pulling both s0 and s1 metadata.

[X]   s0e26 s01e001 anidbid:   13430 air_date: 2018-10-06 abs_number: 0, title: Memory Snow
 - [1] title:   [en] Memory Snow
 - [1] summary: [en] Subaru is looking forward to his date with Emilia, but the changing weather suddenly cools his excitement.
common.LoadFile() - File cached locally - Filename: 'TheTVDB/json/305089/episode_6727916_ja.json', Age: '0.03 days', Limit: '6 days', url: 'https://api.thetvdb.com/episodes/6727916'
 - [ ] thumb: https://thetvdb.plexapp.com/banners/episodes/305089/6727916.jpg
[ ]   s0e27 s00e001 anidbid:   13430 air_date: 2018-10-06
[X]   s0e28 s01e002 anidbid:   13430 air_date: 2019-11-08 abs_number: 0, title: Frozen Bonds
 - [1] title:   [en] Frozen Bonds
 - [1] summary: [en] Covered in ice and snow, Elior Forest is the home to dangerous magical beasts and 50 elves frozen in ice. One day, the great spirit Puck helps a young girl break out of her ice prison. Her name is Emilia, a half-elf born with silver hair, long ears, and amethyst eyes—features that resemble the evil Witch who destroyed half the world long ago.
Shunned by society because of her appearance, Emilia dwells in the forest with Puck as her sole companion and family. Burdened with a sin of destruction she does not remember committing, she spends her days trying to find a way to help her frozen kin. But when the great spirit Melakuera, the Arbitrator of the world, finds Emilia, her right to stay alive is brought into question. Will the bonds of ice she formed with Puck prove to be the warm thread that defies fate?
common.LoadFile() - File cached locally - Filename: 'TheTVDB/json/305089/episode_7427328_ja.json', Age: '0.03 days', Limit: '6 days', url: 'https://api.thetvdb.com/episodes/7427328'
 - [ ] thumb: https://thetvdb.plexapp.com/banners/series/305089/episodes/5e8ae55e892c8.jpg
...
...
[X]    s1e1 s01e001 anidbid:   13430 air_date: 2016-04-04 abs_number: 1, title: The End of the Beginning and the Beginning of the End
 - [1] title:   [en] The End of the Beginning and the Beginning of the End
 - [1] summary: [en] In the series opening double episode, Natsuki Subaru is summoned to a alternate world on his way home one day. At first, he's enamored with this new fantasy world, but the cute girl summoned him? Nowhere to be found. He quickly learns that he doesn't have any of the powers as a gang surrounds him. Right at that moment, she appears…
common.LoadFile() - File cached locally - Filename: 'TheTVDB/json/305089/episode_5519241_ja.json', Age: '0.03 days', Limit: '6 days', url: 'https://api.thetvdb.com/episodes/5519241'
 - [ ] thumb: https://thetvdb.plexapp.com/banners/episodes/305089/5519241.jpg
[X]    s1e2 s01e002 anidbid:   13430 air_date: 2016-04-11 abs_number: 2, title: Reunion with the Witch
 - [1] title:   [en] Reunion with the Witch
 - [1] summary: [en] After being attacked by someone the first time, sliced open by Elsa the second time, and stabbed in the back by punks the third time, Subaru should have been dead, but found himself back where he started in the same parallel world every time. He finally realizes he's acquired the power to go back to the time and place he started from, which he calls "Return by Death." In hopes of changing the fate awaiting Felt, Satella, Old Man Rom, and himself, Subaru takes off for the fourth time.
common.LoadFile() - File cached locally - Filename: 'TheTVDB/json/305089/episode_5570860_ja.json', Age: '0.03 days', Limit: '6 days', url: 'https://api.thetvdb.com/episodes/5570860'
 - [ ] thumb: https://thetvdb.plexapp.com/banners/episodes/305089/5570860.jpg

Please try this. Create a "anime-list-custom.xml" file in "/media/DISK002/Yolo/Re:Zero kara Hajimeru Isekai Seikatsu (2018)/" with the xml content below then refresh metadata for the series and provide "agent-update.log".

<?xml version="1.0" encoding="utf-8"?>
<anime-list>
  <anime anidbid="13430" tvdbid="305089" defaulttvdbseason="0" episodeoffset="" tmdbid="" imdbid="">
    <name>Re:Zero kara Hajimeru Isekai Seikatsu (2018)</name>
    <mapping-list>
      <mapping anidbseason="0" tvdbseason="0">;1-27;2-29;</mapping>
      <mapping anidbseason="1" tvdbseason="0">;1-26;2-28;</mapping>
    </mapping-list>
  </anime>
</anime-list>

Looks like it was updated to have a tvdbid id but not a defaulttvdbseason entry.

Roguyt commented 3 years ago

Looks good to me now. Here is the agent-update.log: Re Zero kara Hajimeru Isekai Seikatsu (2018).agent-update.log

All good in Plex image

EndOfLine369 commented 3 years ago

Cool. Yep, it only pulled the s0 tvdb metadata and not the s1 metadata.

[X]   s0e26 s01e001 anidbid:   13430 air_date: 2018-10-06 abs_number: 0, title: Memory Snow
 - [1] title:   [en] Memory Snow
 - [1] summary: [en] Subaru is looking forward to his date with Emilia, but the changing weather suddenly cools his excitement.
common.LoadFile() - File cached locally - Filename: 'TheTVDB/json/305089/episode_6727916_ja.json', Age: '0.08 days', Limit: '6 days', url: 'https://api.thetvdb.com/episodes/6727916'
 - [ ] thumb: https://thetvdb.plexapp.com/banners/episodes/305089/6727916.jpg
[ ]   s0e27 s00e001 anidbid:   13430 air_date: 2018-10-06
[X]   s0e28 s01e002 anidbid:   13430 air_date: 2019-11-08 abs_number: 0, title: Frozen Bonds
 - [1] title:   [en] Frozen Bonds
 - [1] summary: [en] Covered in ice and snow, Elior Forest is the home to dangerous magical beasts and 50 elves frozen in ice. One day, the great spirit Puck helps a young girl break out of her ice prison. Her name is Emilia, a half-elf born with silver hair, long ears, and amethyst eyes—features that resemble the evil Witch who destroyed half the world long ago.
Shunned by society because of her appearance, Emilia dwells in the forest with Puck as her sole companion and family. Burdened with a sin of destruction she does not remember committing, she spends her days trying to find a way to help her frozen kin. But when the great spirit Melakuera, the Arbitrator of the world, finds Emilia, her right to stay alive is brought into question. Will the bonds of ice she formed with Puck prove to be the warm thread that defies fate?
common.LoadFile() - File cached locally - Filename: 'TheTVDB/json/305089/episode_7427328_ja.json', Age: '0.08 days', Limit: '6 days', url: 'https://api.thetvdb.com/episodes/7427328'
 - [ ] thumb: https://thetvdb.plexapp.com/banners/series/305089/episodes/5e8ae55e892c8.jpg
...
...
[ ]    s1e1 s00e000 anidbid: xxxxxxx air_date: 2016-04-04
[ ]    s1e2 s00e000 anidbid: xxxxxxx air_date: 2016-04-11
Roguyt commented 3 years ago

Should I open a PR on ScudLee's repo to fix the issue ?

EndOfLine369 commented 3 years ago

@Roguyt, yep. That would fix it at the mapping source. I currently see 5 entries with a tvdbid but no default season. tvdbid="[0-9]+" defaulttvdbseason=""

  <anime anidbid="13430" tvdbid="305089" defaulttvdbseason="" episodeoffset="" tmdbid="" imdbid="">
  <anime anidbid="13645" tvdbid="342601" defaulttvdbseason="" episodeoffset="" tmdbid="" imdbid="">
  <anime anidbid="13894" tvdbid="262090" defaulttvdbseason="" episodeoffset="" tmdbid="" imdbid="">
  <anime anidbid="15456" tvdbid="352408" defaulttvdbseason="" episodeoffset="" tmdbid="" imdbid="">
  <anime anidbid="15603" tvdbid="384424" defaulttvdbseason="" episodeoffset="" tmdbid="" imdbid="">

@ZeroQI, looks like we should put in protection logic in HAMA that if there is a tvdbid entry but not a defaulttvdbseason entry, it will remove the tvdbid. Thus it would just default to the anidb id and data. Any objection, other thoughts? We currently either use the season number or default to '1' if empty or 'a'. New logic would be:

If defaulttvdbseason is int: use it
elif defaulttvdbseason=='a': defaulttvdbseason='1'
else: tvdbid, defaulttvdbseason = '', ''
ZeroQI commented 3 years ago

@EndOfLine369 Agreed, there are placeholders to give the tvdbid, but incorrect mappings, so a failsafe would help in this type of scenario...

ZeroQI commented 3 years ago

@EndOfLine369 https://github.com/ZeroQI/Hama.bundle/blob/master/Contents/Code/AnimeLists.py I agree with the code but struggle to find where to place it

ZeroQI commented 3 years ago

While scudlee's pr is still not added, the fix is in Sven7's fork [https://github.com/Anime-Lists/anime-lists/blob/master/anime-list-master.xml], assigned in https://github.com/ZeroQI/Hama.bundle/blob/master/Contents/Code/AnimeLists.py line 15

@EndOfLine369 from your code I got the following to insert in https://github.com/ZeroQI/Hama.bundle/blob/master/Contents/Code/AnimeLists.py line 153 nut unsure about setting defaulttvdbseason from 'a' to 1

if defaulttvdbseason=='a': defaulttvdbseason='1'
elif not defaulttvdbseason.isdigit(): tvdbid, defaulttvdbseason = '', ''
sven-7 commented 3 years ago

If you need any issues with the anime-list fixed, let me know. I've personally abandoned ScudLee's repo. It's barely updated and when they do, they just copy over the new repo a few of us have been working on.

I think this is already fixed in the new one, but I'll double check today. HAMA should already pull from the new repo, right?

ZeroQI commented 3 years ago

Hama does and it's already fixed

Roguyt commented 3 years ago

I just tried again after updating to the latest version (which uses @sven-7's fork) and everything looks good regarding Re:Zero OAV, just needs to manually fix the posters :)