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

Hanamonogatari incorrect partial map #490

Closed
echen92 opened this issue Dec 4, 2021 · 6 comments
Closed

Hanamonogatari incorrect partial map #490

echen92 opened this issue Dec 4, 2021 · 6 comments

Comments

@echen92
Copy link

echen92 commented Dec 4, 2021

Clean library with only one folder for the Hanamonogatari arc.
Matches the show name + description good but episodes come back with meta from bakemonogatari season 1.
Agent-update log seems to indicate it is mapping to both hanamono and bakemono in tvdb. Not using forced guid_type.
s1e1_mapped shouldn't be true since the anime-list mapping from scudlee is AniDB S1 to TVDB S0?
I tried absolute numbering e.g s0E10 with anidb3 and episode meta mapped correctly but the show title + episode numbering pulled from TVDB.
Have tried the troubleshooting steps delete library->stopping server->wipe/update hama/ASS->restart&recreate library.

screenshot

com.plexapp.agents.hama.log
com.plexapp.system.log
Hanamonogatari.agent-search.log
Hanamonogatari.agent-update.log

Hanamonogatari.filelist.log
Hanamonogatari.scanner.log
root.agent.log
root.scanner.log

@ZeroQI
Copy link
Owner

ZeroQI commented Dec 4, 2021

Hanamonogatari ep 1-5 seen by scanner as season 1 ep 1-5 and matched to anidbid 10046 [https://anidb.net/anime/10046]
You labelled incorrectly episodes/filenames as AniDB 5 parts are showing as episodes 02-06 for AniDB.

https://github.com/Anime-Lists/anime-lists/blob/master/anime-list-master.xml

 <anime anidbid="10046" tvdbid="102261" defaulttvdbseason="0" episodeoffset="" tmdbid="" imdbid="">
    <name>Hanamonogatari: Suruga Devil</name>
    <mapping-list>
      <mapping anidbseason="1" tvdbseason="0">;1-0;2-10;3-11;4-12;5-13;6-14;</mapping>
    </mapping-list>
  </anime>

This translates to:

  • anidb s01e01=>tvdb s00e00 [inexistant]
  • anidb s01e02=>tvdb s00e10
  • anidb s01e03=>tvdb s00e11
  • anidb s01e04=>tvdb s00e12
  • anidb s01e05=>tvdb s00e13
  • anidb s01e06=>tvdb s00e14

TVDB s00e10-13 are detected correctly on disk

[X] s0e10 s01e002 anidbid: 10046 air_date: 2014-08-16 abs_number: 0, title: Suruga Devil - Part 1
[X] s0e11 s01e003 anidbid: 10046 air_date: 2014-08-16 abs_number: 0, title: Suruga Devil - Part 2
[X] s0e12 s01e004 anidbid: 10046 air_date: 2014-08-16 abs_number: 0, title: Suruga Devil - Part 3
[X] s0e13 s01e005 anidbid: 10046 air_date: 2014-08-16 abs_number: 0, title: Suruga Devil - Part 4

TVDB s00e143 is not detected correctly

[ ] s0e14 s01e006 anidbid: 10046 air_date: 2014-08-16

TVDB S01e01-05 are detected wrongly and overwrite the metadata from s00exx

[X] s1e1 s01e001 anidbid: xxxxxxx air_date: 2009-07-03 abs_number: 1, title: Hitagi Crab - Part 1
[X] s1e2 s01e002 anidbid: xxxxxxx air_date: 2009-07-10 abs_number: 2, title: Hitagi Crab - Part 2
[X] s1e3 s01e003 anidbid: xxxxxxx air_date: 2009-07-17 abs_number: 3, title: Mayoi Snail - Part 1
[X] s1e4 s01e004 anidbid: xxxxxxx air_date: 2009-07-24 abs_number: 4, title: Mayoi Snail - Part 2
[X] s1e5 s01e005 anidbid: xxxxxxx air_date: 2009-07-31 abs_number: 5, title: Mayoi Snail - Part 3

We should disregard new maping if earlier season mapping exist as failsafe
We should figure out why tvdb to AniDB mapping isn't working as expected

I am not in a position to reproduce the issue at the moment. Will update when i can

@Sn0wCrack
Copy link

Sn0wCrack commented Feb 8, 2022

I ran into this same issue with Nekomonogatari (Kuro), and to be fair the way the Monogatari Series get mapped to TVDB is kind of insane with a lot of the series mapping into random episodes of the Specials / Season 0.

I attempted to try and fix this myself and I've got what seems to work, but unsure of its stability, I simply added the following to TheTVDBv2.py after it performs the episode translation (around Line 176):

      # If this episode already exists in our array it means we've already mapped it, so skip the rest
      # This can occur when something from say Season 0 or a Special is mapped into Season 1 by AnimeLists
      if Dict(TheTVDB_dict, 'seasons', season, 'episodes', episode, default=None):
        continue

Basically, there didn't really appear to be anything checking if an episode already got mapped or not, so if something got mapped in Season 0 to Season 1, it would just get re-matched to the Season 1 episode of the same number.

This just adds a check for if the episode exists already in the output dictionary, seems to work for this case at least, but doesn't really fix up how messed up posters, thumbnails and such are for most of the Monogatari Series entries, since I assume this is mostly an issue of how it all maps back to the Monogatari metaseries on TheTVDB.

EDIT: Potentially disregard the Thumbnail thing, it looks like those are getting set fine, I think the data associated with my Nekomonogatari in Plex has just been through one too many changes so the thumbnail was there, just not set as the default poster.

@Sn0wCrack
Copy link

I've done some more testing with the above and ran into the opposite issue of Episodes mapping from Season 1 into Specials, ironically enough with Bakemonogatari, where Season 1 E13 - E15 get mapped into Season 0 E01 - E03.

I ended up making the following modification to track if an episode was written from a previous one and use that to skip processing the episode instead:

      anidbid=""
      episode_moved_ahead = False
      abs_number = Dict(episode_json, 'absoluteNumber', default=0 if season=='0' else abs_number+1)
      if anidb_numbering:
        
        if Dict(mappingList, 'defaulttvdbseason_a'):
          new_season, new_episode = '1', str(abs_number)
        else: 
          new_season, new_episode, anidbid = AnimeLists.anidb_ep(mappingList, season, episode)
        
      elif metadata_source in ('tvdb3', 'tvdb4'):  
        for s in media.seasons:  #if abs id exists on disk, leave specials with no translation
          if str(abs_number) in list_abs_eps and str(abs_number) in media.seasons[s].episodes and s != "0": 
            new_season, new_episode = s, str(abs_number)
            break

      elif metadata_source=='tvdb5':  
        if abs_number:
          new_season, new_episode = '1', str(abs_number)

      episode_moved_ahead = (new_season > season or (new_season == season and new_episode > episode))

      episode = new_episode
      season = new_season
      
      # If this episode has been written to by a previous entry, such as Season S00E01 -> S010E01
      # we should skip over this one as it's been mapped into previously.
      if Dict(TheTVDB_dict, 'seasons', season, 'episodes', episode, 'episode_moved_ahead', default=False):
        continue

      SaveDict(episode_moved_ahead, TheTVDB_dict, 'seasons', season, 'episodes', episode, 'episode_moved_ahead')

This should handle most of the cases I can think of, even should handle mapping just a single episode ahead.

Will probably test this myself for a bit and see if I run into any issues. If anyone knows of any other shows with funky mapping I'll see if I can test on those as well.

@ZeroQI
Copy link
Owner

ZeroQI commented Feb 8, 2022

Monogatari Series is the most complex series to organise, either anidb numbering and all in a collection or tvdb and potential mapping issues...

The issue with thumbnail, you cannot edit the priority afterwards, so it can give the illusion the default thumbnail is wrong, but i understand the full plex dance is annoying....

we need both a good failsafe, and review the mapping so it works without current known issues.
One of the other bugs brought a change that fixed a problem but brought mapping issues so we need to fix both at once
#500
#496

@Sn0wCrack
Copy link

Yeah, I quickly realised the Thumbnails were still there, just not set as the default "Poster."

I can take a look at some point to see if my changes in any way resolve #496 or #500 sometime in the next week or so.

@ZeroQI
Copy link
Owner

ZeroQI commented Mar 12, 2022

Your issue is that the mapping assign 2 tvdb eps to s01e-001, already mentioned on

Will keep 500 which has better description and pinpointed the change that broke it, and close other bug reports

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

3 participants