advplyr / audiobookshelf

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

[Enhancement]: Discussion thread: better cross-platform session syncing #1113

Open mikehoyle opened 1 year ago

mikehoyle commented 1 year ago

Describe the feature/enhancement

There will be some overlap with the app codebase here, but the idea belongs in core I think. Please de-dupe if there's another discussion, I couldn't find one via search.

Background:

I am a regular listener on mobile (Android) and multiple iterations of the web-app. It's common for me to swap between the mediums (ex. Listen on web while at desktop, swap same book to mobile to go on a walk, then swap to my laptop at the couch when I return). In my experience, progress syncing for a single user is not particularly well supported when listening from multiple sources.

Here's my experience: The web-app typically requires a page refresh in order to sync new progress data, and the mobile app requires a close (i.e. swipe away from apps list) and re-open and reconnect to get an updated sync. Either will happily let you pick up from an outdated local progress point if you're not careful, and that risks overwriting your actual progress.

Ideas

Here are a few high-level ideas for how the experience could possibly be improved. I'll keep ideas constrained to the web-app as is appropriate for this forum, but they could easily be applied to the mobile app:

The downside here is it could restrict a very specific subset of users sharing an account while simultaneously listening to the same book, but that feels like an unsupported case anyways. The server couldn't make heads or tails of the session, and there's no motivation for users to share accounts on a self-hosted server in which unlimited accounts can be created. There's also a corner-case risk progress could be lost on forced sync, but it would be very easy to only sync server progress if it was beyond local progress.

Let me know your thoughts. I'm open to discussion and being involved in implementation, but I don't want to start anything without signoff, or knowledge that similar efforts aren't already underway.

FerriteGiant commented 1 year ago

seconded

BinkieSmalls commented 1 year ago

I am having the same issue with the syncing between web and android. Thank you for offering a workaround at least. I can't help program a solution but would be able to help with testing

mitchins commented 1 year ago

I came here for this very reason.

Even audible doesn't handle this fantastically, but I feel the "kindle" model of "furthest position" would solve this nicely.

There's two issues:

It seems like the server is able to keep the furthest position read ok but the risk here is when resuming a client (such as going from iPad to iPhone) where it's behind, it'll actually update the server status to the position that's behind.

So we have two scenarios:

The first one is easy, we could ping the server for the latest position on resume - I haven't checked out the iOS code base yet but chances are it can be resolved client side with a simple pop up alert.

The second one is more complicated such I don't think we can change the player location easily nor even ask the user. There's a couple of solutions:

  1. marking chapters as read for these books with chapters will help track down where we were.
  2. keeping a log of different clients "max position" would work similarly even if there's no chapters.
  3. least likely of all, there might be a way to use background extensions on mobile to update the player status but it's been a while since I've worked in media apps.

Overall, my recommendation is perhaps to go with 2, keeping a simple log of the head of where each client is up to as a log to jump to.

boomboxnation commented 1 year ago

Very much agreed. A force sync is needed. I am so tired of losing my position while listening to local data on my phone. On the phone. I only listen to local on the phone, I will likely turn to just using ABS as an easy way to download audiobooks to my phone, and use a no-server app.

shall0pass commented 8 months ago

I am also having this issue where the play progress is being lost. Though in my case it's not always just web and android, it also seems to occur when my books are downloaded locally on android and I don't have a server connection at the time. If I listen to a book without a server connection, the next time I open the app the server progress will overwrite the local progress and I'll lose my place. The Libby app has solved this by giving the user an option to use the "Server progress" or "Local progress" if the two differ.

0verEngineer commented 5 months ago

I also switch very often between android and web and i have lost my progress very often.