Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Listening Stats #456

Merged
merged 1 commit into from Dec 7, 2022
Merged

Conversation

benonymity
Copy link
Contributor

Resolves #404. The issue seems to be that the server expects that when syncing an open (streamed) session, the attribute timeListened to be time since the last sync to the server (as per the API docs). But the app uses that logic to store timeListened offline as well, so updates it cumulatively and sends that to the server where the time is compounded. This explains why the listening sessions seemed only slightly off for a few seconds of listening, but exponentially huge (thousands of hours) for longer streamed listens. This PR just adds a bit of logic to reset that timeListening attribute each time there is a server sync when the book is being streamed. I did some testing both with downloaded and local books and the listening time now seems to be reported accurately.

@advplyr
Copy link
Owner

advplyr commented Dec 7, 2022

I did some testing and it is working for me but I never reproduced the original issue.

@advplyr advplyr merged commit 139a0b3 into advplyr:master Dec 7, 2022
@benonymity benonymity deleted the listeningStatsFix branch December 8, 2022 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User stats showing incorrect time (iOS and PC)
2 participants