[Bug]: Listening session isn't tracking correctly #1013

Open
opened 2026-04-24 23:45:53 +02:00 by adam · 7 comments
Owner

Originally created by @LordNyrox on GitHub (Aug 17, 2024).

What was the Problem?

Screenshot_20240817_175603_Samsung Internet
As you can see in the screenshot, listening sessions aren't being tracked correctly. I have checked past sessions, and it seems to have started about two weeks ago.

Steps to Reproduce the Issue

  1. Listen to an audiobook
  2. Let your phone go to sleep automatically
  3. Listen for 20 min or so
  4. And check if tracking is correct

What was Expected?

Listening session time tracking to be precise.

Phone Model

S21 FE

Phone OS

Android 14

Audiobookshelf App Version

Android App - 0.9.76

Installation Source

Google Play Store

Additional Notes

No response

Originally created by @LordNyrox on GitHub (Aug 17, 2024). ### What was the Problem? ![Screenshot_20240817_175603_Samsung Internet](https://github.com/user-attachments/assets/f88e11e0-b087-4409-b8c8-6b59fc7634e2) As you can see in the screenshot, listening sessions aren't being tracked correctly. I have checked past sessions, and it seems to have started about two weeks ago. ### Steps to Reproduce the Issue 1. Listen to an audiobook 2. Let your phone go to sleep automatically 3. Listen for 20 min or so 4. And check if tracking is correct ### What was Expected? Listening session time tracking to be precise. ### Phone Model S21 FE ### Phone OS Android 14 ### Audiobookshelf App Version Android App - 0.9.76 ### Installation Source Google Play Store ### Additional Notes _No response_
adam added the bugwaiting labels 2026-04-24 23:45:53 +02:00
Author
Owner

@advplyr commented on GitHub (Aug 17, 2024):

Is the book downloaded on the device?
Can you confirm this happens when the screen is off and when you keep it on the listening time is correct?

@advplyr commented on GitHub (Aug 17, 2024): Is the book downloaded on the device? Can you confirm this happens when the screen is off and when you keep it on the listening time is correct?
Author
Owner

@LordNyrox commented on GitHub (Aug 18, 2024):

No, it's on my PC, but I believe the issue is related to the screen timeout. As you can see in the first screenshot, it only tracked about 1 minute, even though I listened for 13 minutes. I had the screen timeout set to 1 minute, so it makes sense. The same thing happened with the 2-minute timeout setting on my phone—it only tracked for 1 minute and 47 seconds.
Screenshot_20240818_002914_Samsung Internet
In the second screenshot, I set the screen timeout to 10 minutes and listened for 3 minutes, and it tracked the correct time. It only seems to not track or be inaccurate when the screen timeout is shorter.
Screenshot_20240818_003208_Samsung Internet

@LordNyrox commented on GitHub (Aug 18, 2024): No, it's on my PC, but I believe the issue is related to the screen timeout. As you can see in the first screenshot, it only tracked about 1 minute, even though I listened for 13 minutes. I had the screen timeout set to 1 minute, so it makes sense. The same thing happened with the 2-minute timeout setting on my phone—it only tracked for 1 minute and 47 seconds. ![Screenshot_20240818_002914_Samsung Internet](https://github.com/user-attachments/assets/1a896d08-01e4-4ac2-b303-58ac15834769) In the second screenshot, I set the screen timeout to 10 minutes and listened for 3 minutes, and it tracked the correct time. It only seems to not track or be inaccurate when the screen timeout is shorter. ![Screenshot_20240818_003208_Samsung Internet](https://github.com/user-attachments/assets/5dbf7dfb-cc92-45f6-9028-f02288d8c800)
Author
Owner

@LordNyrox commented on GitHub (Aug 18, 2024):

I also tried version 0.9.72-beta, and the same issue occurred. I set the screen timeout to 30 seconds this time, listened for about 3 minutes, but it only tracked 28 seconds, as seen in the screenshot.
Screenshot_20240818_010517_Samsung Internet

@LordNyrox commented on GitHub (Aug 18, 2024): I also tried version 0.9.72-beta, and the same issue occurred. I set the screen timeout to 30 seconds this time, listened for about 3 minutes, but it only tracked 28 seconds, as seen in the screenshot. ![Screenshot_20240818_010517_Samsung Internet](https://github.com/user-attachments/assets/432d4b10-7f78-4b78-83ad-a1c549f77894)
Author
Owner

@advplyr commented on GitHub (Aug 18, 2024):

Can you check the app settings on your device to see what is set for allowing background activities? This will be different per device and per android version. For pixel 6 on Android 14 the settings to look for are in battery usage and mobile data usage.

image

image

It used to be under battery optimization settings for the app. Let me know what you find for your device

@advplyr commented on GitHub (Aug 18, 2024): Can you check the app settings on your device to see what is set for allowing background activities? This will be different per device and per android version. For pixel 6 on Android 14 the settings to look for are in battery usage and mobile data usage. ![image](https://github.com/user-attachments/assets/7ac0fb07-64b0-425f-b98b-0c438b214949) ![image](https://github.com/user-attachments/assets/e867e6e3-ca5f-48c4-ac9f-98993c87bd19) It used to be under battery optimization settings for the app. Let me know what you find for your device
Author
Owner

@LordNyrox commented on GitHub (Aug 18, 2024):

Screenshot_20240818_162745_Settings
It was set to Optimised, but I changed it to Unrestricted, and the issue persists. As you can see in the screenshot below, it still isn't tracking correctly.
Screenshot_20240818_165942_Samsung Internet

@LordNyrox commented on GitHub (Aug 18, 2024): ![Screenshot_20240818_162745_Settings](https://github.com/user-attachments/assets/c05f4733-4561-4b1b-8694-bbac4cd7672d) It was set to Optimised, but I changed it to Unrestricted, and the issue persists. As you can see in the screenshot below, it still isn't tracking correctly. ![Screenshot_20240818_165942_Samsung Internet](https://github.com/user-attachments/assets/d7fc1148-8b1e-4e97-81a7-8afcc5f00e12)
Author
Owner

@LordNyrox commented on GitHub (Aug 18, 2024):

Even with the screen on, the tracking seems to be off. I've been listening for 10 minutes, but it tracked it as 17 minutes.
Screenshot_20240818_173919_Samsung Internet

@LordNyrox commented on GitHub (Aug 18, 2024): Even with the screen on, the tracking seems to be off. I've been listening for 10 minutes, but it tracked it as 17 minutes. ![Screenshot_20240818_173919_Samsung Internet](https://github.com/user-attachments/assets/d15d8586-b7ac-4b67-a7f4-e28bf13c7862)
Author
Owner

@LordNyrox commented on GitHub (Aug 18, 2024):

I have no coding experience, so I don't know if it's even possible or if this makes sense, but in the next update, the app should subtract the Start Time from the Last Time to fix the issue. The problem seems to only be with "Time Listened," and the Last/Start Time is always tracked accurately.

@LordNyrox commented on GitHub (Aug 18, 2024): I have no coding experience, so I don't know if it's even possible or if this makes sense, but in the next update, the app should subtract the Start Time from the Last Time to fix the issue. The problem seems to only be with "Time Listened," and the Last/Start Time is always tracked accurately.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1013