[Enhancement] Improved offline session handling for iOS #960

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

Originally created by @justcallmelarry on GitHub (Apr 29, 2024).

Is your feature request related to a problem? Please describe.

When listening to long books without ever closing the app or the player, it seems like there is only one offline listening session created, which is continually updated on the server side.
This often ends up with me getting the entire book as "one session" reported in the stats on a specific day, with no minutes allocated to the previous two days.

Describe the solution you'd like

I think that a session being reset to get a new ID and count as a new session if the app has been paused for longer than X minutes (maybe 10-15? 10 is normal for "smart rewind" in different apps) would make sense.
So if you listen for 3 hours, then pause and go to sleep, and when you pick it back up eight hours later a new session is started, rather than adding onto the session of the 3 hours before going to sleep.
I would guess that the functionality to reset to a new session already exists, since if you close the player this is what happens. This is also my current workaround, to try to remember to close the player and start listening to the book anew at least once per day.

Describe alternatives you've considered

Most alternatives I've considered are to handle the sessions differently in the server, but those would most likely be huge changes :) I'm hoping this is a rather small one (if timestamps are stored in the session in the app=.

Additional context

Not a huge deal, I just love stats!

Originally created by @justcallmelarry on GitHub (Apr 29, 2024). ### Is your feature request related to a problem? Please describe. When listening to long books without ever closing the app or the player, it seems like there is only one offline listening session created, which is continually updated on the server side. This often ends up with me getting the entire book as "one session" reported in the stats on a specific day, with no minutes allocated to the previous two days. ### Describe the solution you'd like I think that a session being reset to get a new ID and count as a new session if the app has been paused for longer than X minutes (maybe 10-15? 10 is normal for "smart rewind" in different apps) would make sense. So if you listen for 3 hours, then pause and go to sleep, and when you pick it back up eight hours later a new session is started, rather than adding onto the session of the 3 hours before going to sleep. I would guess that the functionality to reset to a new session already exists, since if you close the player this is what happens. This is also my current workaround, to try to remember to close the player and start listening to the book anew at least once per day. ### Describe alternatives you've considered Most alternatives I've considered are to handle the sessions differently in the server, but those would most likely be huge changes :) I'm hoping this is a rather small one (if timestamps are stored in the session in the app=. ### Additional context Not a huge deal, I just love stats!
adam added the enhancement label 2026-04-24 23:44:19 +02:00
adam closed this issue 2026-04-24 23:44:20 +02:00
Author
Owner

@advplyr commented on GitHub (Apr 29, 2024):

This has been discussed a bunch and doesn't just apply to mobile apps. The bug report open for that is https://github.com/advplyr/audiobookshelf/issues/1445

@advplyr commented on GitHub (Apr 29, 2024): This has been discussed a bunch and doesn't just apply to mobile apps. The bug report open for that is https://github.com/advplyr/audiobookshelf/issues/1445
Author
Owner

@advplyr commented on GitHub (Apr 29, 2024):

Duplicate of https://github.com/advplyr/audiobookshelf/issues/1445

@advplyr commented on GitHub (Apr 29, 2024): Duplicate of https://github.com/advplyr/audiobookshelf/issues/1445
Author
Owner

@justcallmelarry commented on GitHub (Apr 30, 2024):

Ah, sorry! I did use the search function first but did not find that issue.

EDIT: ah, because it wasn't in this repo

I still think the issue is a bit different, since this proposed change does not solve any of the actual midnight/incorrect dates raise in the mentioned issue, just to chop up the current session handling that is handled by mobile, but I will accept that you might have plans to solve it on server level at some point and do not wish to put time on it now.

@justcallmelarry commented on GitHub (Apr 30, 2024): Ah, sorry! I did use the search function first but did not find that issue. EDIT: ah, because it wasn't in this repo I still think the issue is a bit different, since this proposed change does not solve any of the actual midnight/incorrect dates raise in the mentioned issue, just to chop up the current session handling that is handled by mobile, but I will accept that you might have plans to solve it on server level at some point and do not wish to put time on it now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#960