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

Statistics Endpoints: avoid huge results

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

      When I query my artist stats, I get a JSON payload of nearly a megabyte, containing 7500+ entries. That seems a waste of resources; the user is generally unlikely to want to see that many results.

      On the other hand, if I specify a limit of 10, I am not told there are 7500+ entries available.

      I would strongly recommend:

      1. adding an extra field (max_count? total?) containing the total number of available items
      2. defaulting the count to some documented constant (10, 40, and 100 all seem like viable music-related defaults)
      3. limit the range of count (0-250? 0-500?) so that users need to perform multiple (rate-limited) requests instead of being able to grab one giant payload (a count of 0 could be used just to get the max count and last-update timestamp)

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

          Statistics Endpoints: avoid huge results

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

              When I query my artist stats, I get a JSON payload of nearly a megabyte, containing 7500+ entries. That seems a waste of resources; the user is generally unlikely to want to see that many results.

              On the other hand, if I specify a limit of 10, I am not told there are 7500+ entries available.

              I would strongly recommend:

              1. adding an extra field (max_count? total?) containing the total number of available items
              2. defaulting the count to some documented constant (10, 40, and 100 all seem like viable music-related defaults)
              3. limit the range of count (0-250? 0-500?) so that users need to perform multiple (rate-limited) requests instead of being able to grab one giant payload (a count of 0 could be used just to get the max count and last-update timestamp)

                    ishaanshah Ishaan Shah
                    zastai Tim Van Holder
                    Votes:
                    0 Vote for this issue
                    Watchers:
                    2 Start watching this issue

                      Created:
                      Updated:

                        Version Package

                          ishaanshah Ishaan Shah
                          zastai Tim Van Holder
                          Votes:
                          0 Vote for this issue
                          Watchers:
                          2 Start watching this issue

                            Created:
                            Updated:

                              Version Package