ZeroQI / Hama.bundle

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

Skip episode if another is mapped to its value #518

Closed cameronkinsella closed 2 years ago

cameronkinsella commented 2 years ago

If a TVDB episode is mapped to a value that already exists in TVDB then duplicate episodes will be matched. This causes only the final match to be used for metadata, which could be the wrong one.

This fix should resolve the episode name mapping issue for anidb to TVDB.

Since thumbnails are still stored by their mapped values, this does not resolve the issue where the incorrect thumbnails are sometimes chosen as the default. In this case, the correct thumbnail will still be available as the second choice when editing the episode in plex, so you can manually fix them without too much effort.

Partially resolves #500

cameronkinsella commented 2 years ago

I have only tested this with one affected series (Monogatari series), so I would appreciate it if someone else could test it as well.

natyusha commented 2 years ago

Tested with several series that were previously mapped incorrectly and this fixed all of them.

zyfinity01 commented 2 years ago

Does this also fix the poster being incorrect such as in issue #500 ?

plato79 commented 1 year ago

This didn't fix the problem in https://github.com/ZeroQI/Hama.bundle/issues/500#issuecomment-1171461901

natyusha commented 1 year ago

The pr does what it says and fixes the matching for series that share things under the same entry on tvdb (multiple seasons / specials / ovas / movies).

I saw "Violet Evergarden Gaiden: Eien to Jidou Shuki Ningyou" used as an example of a movie that isn't matching correctly but that is actually an issue with anime-list-master.xml which is pointing to the wrong episode.

<anime anidbid="14840" tvdbid="330139" defaulttvdbseason="0" episodeoffset="1" tmdbid="610892" imdbid="tt10477558">
  <name>Violet Evergarden Gaiden: Eien to Jidou Shuki Ningyou</name>
</anime>

It is pointing to season 0 of the main series (which doesn't contain any trace of the movie).

plato79 commented 1 year ago

Well, so the problem in #500 is on the metadata and not in the code then if I understand correctly..

The weird thing is when I undo https://github.com/ZeroQI/Hama.bundle/commit/b475676bcc72fe2a9076b8d86394d1acf7a87bf0 this appear correctly so it was pulling the data another way before this fix.