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

Anilist "GetAnimeList" fixes #112

Closed vosmiic closed 3 months ago

vosmiic commented 3 months ago

This PR fixes the issue of hitting into a 429 during manual sync (fixes #109).

The fixes include:

  1. Using the chunked graphql query to retrieve more results per API call.
  2. Increasing sleep to 2000ms.

Also instead of parsing the ID from the site URL, we now just request it directly in the query.

macluxHD commented 3 months ago

So I tested it and noticed that it was reaching the 10 page limit which I found weird. Turns out that it requested the same chunk over and over again.

After looking at the code it turns out that variables["page"] is being updated for every iteration instead of variables["chunk"] which is line 271 in AniListApiCalls.cs. As such it requested the same data over and over again and the hasNextChunk was always true so it reached the 10 page limit.

I quickly updated the line and build it again, tested it and it seems to work fine now. Seems like this is the only issue though.

vosmiic commented 3 months ago

Ah yeah, good catch. Added it to the PR.