aniyomiorg / aniyomi

An app for manga and anime
https://aniyomi.org
Apache License 2.0
4.92k stars 317 forks source link

Anime trackers making duplicate activity #1508

Closed perokhe closed 1 month ago

perokhe commented 6 months ago

Steps to reproduce

  1. Have tracking services.
  2. Have a mark episodes as seen point less than 100%.
  3. Watch an episode of an anime.

Expected behavior

Trackers should only make a single request to update last seen episode.

Actual behavior

The tracker makes multiple requests resulting in duplicate activity in Anilist or same episode counted multiple times in MyAnimeList history.

Crash logs

No response

Aniyomi version

0.15.2.4

Android version

Android 10

Device

Samsung Galaxy Note 9

Other details

Screenshot_20240319-045429_Firefox Nightly Screenshot_20240319-045923_Firefox Nightly

Acknowledgements

perokhe commented 6 months ago

I think after the second you pass the point to mark as seen, it refreshes the local data with the tracker data multiple times and then it tries to update the tracker with the last seen episode each time. For example:

perokhe commented 6 months ago

https://github.com/aniyomiorg/aniyomi/blob/1c34c4c1b9ee700c971991ed918aab57f027da53/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt#L370-L376

I think adding !currentEp.seen to the condition could be an easy fix but it doesn't deal with failed requests.

Secozzi commented 1 month ago

This has most likely been fixed in the preview version with the merge from Mihon. If the issue still persists even after switching to preview or in the next stable update, please open a new issue.