[Bug]: Incorrect value for total number of listening sessions on User Detail Page #747

Closed
opened 2026-04-24 23:19:18 +02:00 by adam · 5 comments
Owner

Originally created by @austinphilp on GitHub (Nov 11, 2022).

Describe the issue

When navigating to /config/users/<USER_ID> on the web app, under the "Listening Stats" section there is a counter indicating the number of Listening Sessions over all time. It appears that this counter will always yield a value of 10 or lower, even if more than 10 listening sessions exist.

It appears at first glance like the code is taking the length of recentSessions in the api/users/root/listening-stats response, but recentSessions will only ever have at most 10 entries. We probably want to add a field to listening-stats totalListeningSessions (or something similar) which will have an int value representing the total number of sessions.

Happy to take this on myself if no one objects, I just started using this project a few weeks ago and would love to contribute!

Steps to reproduce the issue

  1. On the config/users webpage, select a user with more than 10 listening sessions
  2. Scroll down to the Listening Stats section
  3. Observe that the Listening Sessions value is 10.

Audiobookshelf version

v2.2.1

How are you running audiobookshelf?

Docker

Originally created by @austinphilp on GitHub (Nov 11, 2022). ### Describe the issue When navigating to `/config/users/<USER_ID>` on the web app, under the "Listening Stats" section there is a counter indicating the number of Listening Sessions over all time. It appears that this counter will always yield a value of `10` or lower, even if more than 10 listening sessions exist. It appears at first glance like the code is taking the length of `recentSessions` in the `api/users/root/listening-stats` response, but `recentSessions` will only ever have at most 10 entries. We probably want to add a field to `listening-stats` `totalListeningSessions` (or something similar) which will have an int value representing the total number of sessions. Happy to take this on myself if no one objects, I just started using this project a few weeks ago and would love to contribute! ### Steps to reproduce the issue 1. On the `config/users` webpage, select a user with more than 10 listening sessions 2. Scroll down to the `Listening Stats` section 3. Observe that the `Listening Sessions` value is 10. ### Audiobookshelf version v2.2.1 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:19:18 +02:00
adam closed this issue 2026-04-24 23:19:19 +02:00
Author
Owner

@advplyr commented on GitHub (Nov 11, 2022):

Yep that is a mistake for sure. The solution you mentioned with a totalListeningSessions variable sounds good to me. Let me know if you have questions setting up the project locally. I'm also active on our discord/matrix servers.

@advplyr commented on GitHub (Nov 11, 2022): Yep that is a mistake for sure. The solution you mentioned with a `totalListeningSessions` variable sounds good to me. Let me know if you have questions setting up the project locally. I'm also active on our discord/matrix servers.
Author
Owner

@austinphilp commented on GitHub (Nov 11, 2022):

@advplyr Sounds good! I'll probably work on getting it setup tonight, I'll find you on discord if something goes amiss

@austinphilp commented on GitHub (Nov 11, 2022): @advplyr Sounds good! I'll probably work on getting it setup tonight, I'll find you on discord if something goes amiss
Author
Owner

@austinphilp commented on GitHub (Nov 12, 2022):

fixed in #1144

@austinphilp commented on GitHub (Nov 12, 2022): fixed in #1144
Author
Owner

@austinphilp commented on GitHub (Nov 12, 2022):

Re-opened - just realized we should leave this open until release

@austinphilp commented on GitHub (Nov 12, 2022): Re-opened - just realized we should leave this open until release
Author
Owner

@advplyr commented on GitHub (Nov 13, 2022):

Fixed in v2.2.3

@advplyr commented on GitHub (Nov 13, 2022): Fixed in [v2.2.3](https://github.com/advplyr/audiobookshelf/releases/tag/v2.2.3)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#747