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

Issues with seasons 2 and onwards not being found on anilist even though season 1 works fine #86

Open
SnowySailor opened this issue Jul 8, 2024 · 3 comments

Comments

@SnowySailor
Copy link

SnowySailor commented Jul 8, 2024

My plex uses Japanese titles and when a show has more than one season, the first season is picked up without issue but the second (and any others after it) are "not found" on anilist. Here are a few examples, but this happens with every single show with more than 1 season that I've looked at:

image
image
image
image

What seems to fix the problem:

Manually copying the entry for the English title, but then replacing it with the Japanese title in my own custom-mappings file. Example for fixing Oshi no Ko:

- title: "[推しの子]"
    guid: plex://show/62a3245d52758f8243740884
    # imdb: https://www.imdb.com/title/tt21030032/
    # tmdb: https://www.themoviedb.org/tv/203737
    # tvdb: https://www.thetvdb.com/dereferrer/series/421069
    seasons:
      - season: 1
        anilist-id: 150672
      - season: 2
        anilist-id: 166531

The exact same plex guid and seasons entries are used, but the title is changed to the Japanese one. I've only tested this on a few shows and it seems to work but I haven't checked more than a handful. When I enter the plex guid link into my browser, it opens the correct show, so I know the guid association is still correct even with the JP title in plex.

I am using this url: https://raw.githubusercontent.com/RickDB/PlexAniSync-Custom-Mappings/main/series-tvdb.en.yaml and ghcr.io/rickdb/plexanisync:latest

@SnowySailor
Copy link
Author

SnowySailor commented Jul 8, 2024

image
I'm doing (I think) the same search that's being done but through the anilist UI and it seems to be returning a result, so it's strange that these mappings aren't working for multiple seasons. Or does this search not even matter since it should just be using the anilist ids from the custom mappings?

@SnowySailor
Copy link
Author

SnowySailor commented Jul 8, 2024

I believe I've found the root cause of the issue. I'm using Hama.bundle which ends up overwriting the plex guids that you get back from their API:
image

This is not an issue for custom mappings when plex uses english titles because the custom mapping lookups can work with english titles as well:
image
image

However, with a Japanese title and a broken guid from Hama, there can be no custom mappings done for Japanese shows when using Hama.bundle. However, there is still the manual anilist search fallback in case there are no custom mapping matches. This works fine for season 1 shows, but it breaks for season 2+ shows (I suspect for all season 2+ shows regardless of language but I haven't tested). This is what I found.

In __find_id_season_best_match in anilist.py several potential titles are generated and stored in potential_titles, and then titles_for_matching is generated for each match by cleaning the titles that come back from anilist. Then these values are compared to see if there's any matches.
image
image
This technically can work, but I think there should be a 第{season}期 option added as a potential title. This doesn't catch everything (it misses a lot of stuff still) but it's maybe a good start.

A complete solution would be to add Japanese titles for each entry in the list as some sort of alias or alternative that would be picked up as a valid custom mapping name. Another option is to add the Hama entries. I think this would solve the issue with no code changes.

@Soitora
Copy link
Collaborator

Soitora commented Jul 8, 2024

Our community mappings are meant to work with the Plex Agent and either TVDB or TMDB, as that's what the Plex agent supports. It looks like you are using the Hama Agent with AniDB, but trying to make it work with Plex Agent with TheTVDB.

If you use the Hama Agent, I suggest you do a custom mapping where you add the Hama agents guid (com.plexapp.agents.hama//anidb-17449?lang=ja), that way it shouldn't even matter what title is used, as it will use guid.

Correct me if you feel I misunderstod any part of your message.

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