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

Read Anidb ID from the season before trying to use the season offset from Tvdb #119

Open
Terrails opened this issue Apr 9, 2024 · 4 comments

Comments

@Terrails
Copy link

Terrails commented Apr 9, 2024

Currently the plugin doesn't really like any kind of setup where specials are in their own season, resulting in seasons being detected wrongly. I'm using Shokofin as my metadata provider and it uses S1 normally, but the specials that aired after (and have their own anime entry on anidb) are in their own season marked as S2, with actual S2 getting offset to S3. This causes this plugin to think that the actual S2 is S3 and updates the wrong entry in the list. I was talking about the slime isekai (TenSura) in this example, but there most definitely are more examples.

The author of Shokofin told me that they set the AniDB id per season here. Ani-sync seems to be fetching that ID but uses it just to find the Tvdb ID and then just uses the season with the same number as the one set in jellyfin.

My question is that if a season already has an AniDB id set, shouldn't that just be returned directly from the GetAniDbId method? I have tested this myself and it seems to make it work as intended. As far as I am aware the Anidb plugin only sets this id on a series level, so anything set at season level should only be set by Shokofin.

@vosmiic
Copy link
Owner

vosmiic commented Apr 11, 2024

Special support by the plugin has always been a bit awkward. I have been meaning to re-write some of the logic around the detection of specials because, as you have experienced, its not good.

My question is that if a season already has an AniDB id set, shouldn't that just be returned directly from the GetAniDbId method? I have tested this myself and it seems to make it work as intended. As far as I am aware the Anidb plugin only sets this id on a series level, so anything set at season level should only be set by Shokofin.

Yes, you are right, we should be using the season level AniDB ID, if it exists. The reason that we don't bother checking was because of the AniDB metadata plugin that, as you outlined, sets it at the series level which forces the plugin to use the season number set by Jellyfin which isn't always accurate.

That being said, I am now aware of the Shokofin plugin, and would like to add support for its metadata capabilities to this plugin. As it sets the AniDB ID at the season level, it could very potentially become the most compatible metadata provider for the plugin.

I am currently away from my dev PC so development is slow, but I will take a look at this when I get a chance. As a quick, temporary workaround I will test your solution of just returning the season level AniDB ID and see if I can get it into the upcoming beta release.

@Terrails
Copy link
Author

I have compiled my own version of ani-sync which just returns the AniDB id when its set on a season level and it has been working great for now.

Shokofin's solution does require Shoko Server, so it cannot work on its own, but compared to every other provider, it probably gives the best experience for anime in Jellyfin, so thank you for considering support for it!

@vosmiic vosmiic added this to todo in general ideas Apr 17, 2024
@revam
Copy link
Contributor

revam commented Apr 25, 2024

Just adding some information from my/our side on this issue:

The Shokofin plugin currently provides the AniDB anime ID on season/series entries and the AniDB episode ID for the first episode of the given type on episode entries to Jellyfin for other plugins to use. Though when using the IDs in a library managed by the plugin, there are a couple of specific challenges that need addressing:

  • Users can hide episodes in Shoko, which impacts the episode numbers displayed in Jellyfin. The episode numbers used by the Shokofin plugin are based on the relative-ness of the non-hidden episodes in Shoko, thus they only match AniDB episode numbers if no episodes are hidden. If you need the exact AniDB episode number(s) for an episode entity in Jellyfin — whether as a range that includes all episode numbers or just the first one, with or without the type prefix — we can provide that for your plugin to consume in the future, but it is not currently available.
  • Shokofin is generating "seasons" based on the user's collection in Shoko, and may generate them in an order that does not confront to any online databases (such as TvDB or TMDB), generating up to two different "seasons" per anime within the "series," such as one "season" for normal type episodes and another for other type episodes. Most of the time there will be no other type "season," but there exists edge cases where it will generate the normal type, both, or the other type.

In 99% of use cases, these challenges won't be an issue. However, for the remaining 1%, using just the AniDB anime ID and the episode number within the season to determine episodes for syncing can be problematic. Deeper integration between the plugins will be necessary to ensure accurate syncing of AniList episode statuses in libraries managed by the Shokofin plugin. Feel free to ask me for more details about Shokofin or Shoko (if needed) or propose a solution if you believe we can work together to integrate our plugins. Or, if you believe this is outside the scope of your plugin to support, feel free to say no, and we'll leave it at this. We'll respect your decision either way. 🙂

@vosmiic
Copy link
Owner

vosmiic commented Apr 27, 2024

Thanks @revam, I think getting our plugins to work together makes absolute sense, since they both compliment each other, and I will most definitely take you up on that offer.
Like I said in my previous comment, I am currently away from my dev PC so I am not extending the functionality of the plugin at the moment and really only fixing major bugs, but when I am next able to work on the plugin (should be mid to late May) I'll look into adding support for the Shokofin plugin.
If I have any questions (I'm sure I will) I'll open an issue/discussion on the Shokofin repo.
Thanks again for offering to work together on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: todo
Development

No branches or pull requests

3 participants