LeoKlaus / plappa

An Audiobook client for Jellyfin and AudioBookShelf, written in Swift/SwiftUI.
https://plappa.me
232 stars 1 forks source link

[Feature Request] Update listening stats on ABS #83

Open Drikani opened 6 months ago

Drikani commented 6 months ago

Describe the bug When listening to an Audiobook through Plappa on a ABS-Server it does not update the User-Statistics.

To Reproduce Steps to reproduce the behavior:

  1. Open a Audiobook with Plappa (Downloaded or Streaming dos not matter)
  2. Open your own statistics with the button on the web on the top right
  3. Statistics does not get updated

Expected behavior The statistics should be updated by Plappa on the ABS-Server while listening to a Audiobook.

Environment(please complete the following information):

LeoKlaus commented 6 months ago

plappa doesn't create a listening session within ABS, which is why the statistics are not updated.

This is already on my roadmap.

LeoKlaus commented 4 months ago

With the latest 1.3.0 beta from TestFlight, listening statistics should be updated. There are still some issues with this, but it should release with the next update.

Drikani commented 4 months ago

Yeah I can see now that it updates the listening statistics but it skipped my current audiobook directly to finished instead of syncing the exact timestamp and playtime. Are these the issues you describe or is it something differen?

LeoKlaus commented 4 months ago

I've just released 1.3.0 build 13 to TestFlight, that fixes the issue of audiobooks incorrectly appearing as finished.

Drikani commented 4 months ago

Yeah it does work now correctly! Perfect thank you very much.

justcallmelarry commented 1 month ago

Been using plappa for several books now in order to test out the session handling and all in all I think it's already on par with the first party app.

My one main gripe is that as long as you continue to listen to a book, without restarting the app, you are more or less just continuing on one session. Even when I stopped listening at 22:00 and unpaused at 09:00 or something like that, it just continued on the same session, making en entire session show up on one day in the stats on the server. (this same issue exists in the first party app as well)

A somewhat simple fix, which would also not be perfect, but a huge improvement, would be that you reset and start new sessions after X minutes (10-30 or something) of inactivity (being paused).

This would still end up with some sessions being reported on one date even if being listened to on different dates (if you continue over midnight) but would at least make sessions be naturally spaced out over days, and if your listening habits are somewhat routine, then the amounts in the stats will be more or less correct in any case.

I often listen to 20h+ books, so I often end up with 16h+ listening sessions that were in reality spread out over two to five days, unless I remember to close down the app and restart sometime close to midnight

LeoKlaus commented 1 month ago

I often listen to 20h+ books, so I often end up with 16h+ listening sessions that were in reality spread out over two to five days, unless I remember to close down the app and restart sometime close to midnight

Makes sense. I'm the kind of person that force closes most apps after using them, so I never ran into this issue, but it's a perfectly normal use case.

A somewhat simple fix, which would also not be perfect, but a huge improvement, would be that you reset and start new sessions after X minutes (10-30 or something) of inactivity (being paused).

I think this is a good idea!

0x20Fearless commented 3 weeks ago

Does it also work the other way around?

I seem to notice when I have a session on Web ABS, and say I have 16h left of a 20h audiobook, if I had another book session active on the phone in plappa, it resumes the old phone session.

I have to go into settings and log out of ABS, log-in, and then it's up-to-date.

I thought I could pull down on the home page to "refresh" my progress, but that does nothing.

0x20Fearless commented 3 weeks ago

To clearify a bit:

justcallmelarry commented 1 week ago

Does it also work the other way around?

I seem to notice when I have a session on Web ABS, and say I have 16h left of a 20h audiobook, if I had another book session active on the phone in plappa, it resumes the old phone session.

I have to go into settings and log out of ABS, log-in, and then it's up-to-date.

I thought I could pull down on the home page to "refresh" my progress, but that does nothing.

Not sure if this works, but does force closing the app and reopening it give you the same result as logging out and in again?

0x20Fearless commented 1 week ago

Does it also work the other way around? I seem to notice when I have a session on Web ABS, and say I have 16h left of a 20h audiobook, if I had another book session active on the phone in plappa, it resumes the old phone session. I have to go into settings and log out of ABS, log-in, and then it's up-to-date. I thought I could pull down on the home page to "refresh" my progress, but that does nothing.

Not sure if this works, but does force closing the app and reopening it give you the same result as logging out and in again?

It only loads fine after logging out and in again.

ABS had some updates in the last couple of days and I havent used plappa since. Was about to sponsor them, but the app is now unusable for me.

Might try with a Jellyfin server to see if the issue persists.

LeoKlaus commented 1 week ago

Sorry for the late response, this thread flew under my radar.

I thought I could pull down on the home page to "refresh" my progress, but that does nothing.

Pulling down only refreshes metadata. Sessions are always synced whenever plappa moves to the foreground or before starting playback.

Can you check the debug logs in plappa for errors? You can find them at the bottom of the settings tab.

0x20Fearless commented 1 week ago

Sorry for the late response, this thread flew under my radar.

I thought I could pull down on the home page to "refresh" my progress, but that does nothing.

Pulling down only refreshes metadata. Sessions are always synced whenever plappa moves to the foreground or before starting playback.

Can you check the debug logs in plappa for errors? You can find them at the bottom of the settings tab.

v2.16.2 of Audiobookshelf seem to have fixed the issue for me in Plappa: this issue to be exact.

So far it seems when I continue to listen on desktop and wanna resume on mobile, I need to open Plappa and just wait a bit (like 10-20s) for it to load all my progressions.