advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.17k stars 431 forks source link

[Bug]: Session tracking doesn't count past midnight #1445

Open DieselTech opened 1 year ago

DieselTech commented 1 year ago

Describe the issue

As soon as the local time passes midnight the tracking stats don't carry over into the new day. This makes it possible to accumulate more than 24 hours in a single day since it only counts from when the websocket is opened.

image image

Steps to reproduce the issue

  1. Listen while the clock passes midnight
  2. Check the stats to see the listening time for the new day is 0

Audiobookshelf version

2.2.12

How are you running audiobookshelf?

Docker

benonymity commented 1 year ago

+1 for this, it's rather annoying to have a listening session over multiple days be counted only for one day, and if you leave it open all night than even closing the player next day will shift the session over by a day on how it's time is displayed. Not sure whether this is a client thing though since the session would probably need to be ended and a new one began at midnight

Commiccannon commented 1 year ago

IDK if my issue is a part of this but i will post it here before opening a new thread but somehow i listened to 15.7 days worth of books on a single day (It looks like a good portion of my listening time got shifted to a single day) image If this should be a new thing i will open one just wanted to not have a duplicate

Demian98 commented 7 months ago

Are there any ideas to solve this issue?

It is quite annoying as it makes this really great statistics feature nearly useless.

justcallmelarry commented 4 months ago

I'll add here that I think that it would be nifty if new sessions could be created when you've had the playback paused for X min.

This would allow sessions to organically be shorter and would solve a big part of the "whole book gets reported on one day", even if it does not really solve the session going over midnight.

The app does this when you close the player in the app, so perhaps that functionality could be used when unpausing as well? Provided that there is a timestamp for when you paused it last.