danejur / AniDroid

Do What The F*ck You Want To Public License
9 stars 1 forks source link

Incorrect "days watched" value in AniDroid user profiles #9

Open Rainyan opened 1 year ago

Rainyan commented 1 year ago

Hi, first of all thanks for the great app. I've noticed a bug as follows:

AniDroid is displaying an incorrect "X days watched" value in users' profile pages.

Here is a screenshot (not my user profile, but this is replicable for all profiles with sufficiently large watch time values) from in-app, showing "61.4 days":

AniDroid screenshot

And here is the same data, accessed from a browser at https://anilist.co/user/1:

daysWatched

Here's a GraphQL query that reproduces this behaviour:

{
  User(id: 1) {
    siteUrl
    # Deprecated
    stats {
      watchedTime
    }
    # Should use this, instead
    statistics {
      anime {
        minutesWatched
      }
    }
  }
}

which outputs:

{
  "data": {
    "User": {
      "siteUrl": "https://anilist.co/user/1",
      "stats": {
        "watchedTime": 88410
      },
      "statistics": {
        "anime": {
          "minutesWatched": 91850
        }
      }
    }
  }
}

with 88410 / 60 / 24 ≈ 61.4 days (incorrect value from the deprecated API) and 91850 / 60 / 24 ≈ 63.8 days (correct value from the newer API)

danejur commented 1 year ago

Good call-out! I'll update the User call to make use of those new fields. Thanks!