Uploaded image for project: 'ListenBrainz'
  1. ListenBrainz
  2. LB-1739

API endpoint `1/stats/sitewide/artists` returns wrong "count"

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • API
    • None

      When querying a user's top artists, the API returns two counters:

      • `count`: The number of artists in the current payload;
      • `total_artist_count`: The total number of artists in the user's listens.

      One would expect the "site-wide" top artist endpoint to follow the same naming. Instead:

      • `count` is the total number of artists;
      • And there is no field containing the number of artists in the current payload.

      On top of being very confusing, it makes pagination harder: in order to fetch the "previous" page of site-wide artists, one would need to query the API with the `offset` parameter equal to "current offset - current count".

          [LB-1739] API endpoint `1/stats/sitewide/artists` returns wrong "count"

          Monkey added a comment -

          Pending deployment, but fixed.

          Monkey added a comment - Pending deployment, but fixed.

          GitHub Bot added a comment -

          See code changes in pull request #3237 submitted by MonkeyDo.

          GitHub Bot added a comment - See code changes in pull request #3237 submitted by MonkeyDo .

          Hi! This is my first contribution to Metabrainz' Jira. I did my best to provide detail about the problem, please let me know if something is wrong.

          Thanks for your understanding! ❤️

          Richard-Degenne added a comment - Hi! This is my first contribution to Metabrainz' Jira. I did my best to provide detail about the problem, please let me know if something is wrong. Thanks for your understanding! ❤️

            mr_monkey Monkey
            Richard-Degenne Richard-Degenne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package