vosmiic / jellyfin-ani-sync

Synchronize anime watch status between Jellyfin and anime tracking sites.
GNU General Public License v3.0
214 stars 15 forks source link

partially fix episode offsets #141

Closed tie closed 2 weeks ago

tie commented 3 weeks ago

This hopefully fixes some easy cases for episode offsets with recent sequels like Mushoku Tensei Season 2 Part 2 (in particular, for providers like Shikimori that rely heavily on external IDs, i.e. MAL in case of Shikimori).

Note that correct episode offset handling is more involved than what is currently implemented in this PR, see https://github.com/Anime-Lists/anime-lists?tab=readme-ov-file#format


Resolved issue with arm-server For some reason https://arm.haglund.dev/api/ids?source=anidb&id=18104 returns `null`. I’m not really sure what the issue is since we find the correct AniDB anime season from offline database (that is, https://anidb.net/anime/18104) and looks like https://github.com/Fribb/anime-lists (that https://github.com/BeeeQueue/arm-server is supposed to be using) defines mappings for other providers. In addition to that, I’ve made these changes a few weeks ago and _IIRC_ arm-server API did not return null back then. Same issue with https://anidb.net/anime/17431, 3rd konosuba season, i.e. https://arm.haglund.dev/api/ids?source=anidb&id=17431
tie commented 3 weeks ago

Looks like Konosuba and Mushoku Tensei series get deduplicated because each entry has the same themoviedb_id set ("themoviedb_id": 65844 and "themoviedb_id": 94664 respectively). https://github.com/BeeeQueue/arm-server/blob/a2b828acdd6c6dd4e23086359d503f2135d2f3b9/src/update.ts#L64-L82

These IDs were recently introduced in https://github.com/Fribb/anime-lists/commit/0d22a783, that explains why this change was working before for my use case.

vosmiic commented 2 weeks ago

Good to see the issues with the API sorted; that was causing other issues with the plugin, as can be seen on the issue list. Thanks for raising it on their repo.

As for this PR it looks good, are there any further changes you would like to implement before I merge this?

Note that correct episode offset handling is more involved than what is currently implemented in this PR

And is something I have been meaning to look into for some time. Once I get the list of issues down I will probably spend some time working on it.

TODO: make URL user-configurable to allow self-hosting the server.

Good idea, I have also wanted to host the ARM server myself and set it as the primary service the plugin uses, and set their hosted version as a backup, but letting users use a self hosted offline database API is a great idea. I'll add it to the list of things to look into.

Thanks for the PR!

tie commented 2 weeks ago

As for this PR it looks good, are there any further changes you would like to implement before I merge this?

Not unless it breaks something else, but this change has been working fine for me, so should be ready for merge.