TortugaPower / BookPlayer

Player for your DRM-free audiobooks
GNU General Public License v3.0
1.64k stars 195 forks source link

Sync between devices #287

Closed pichfl closed 1 year ago

pichfl commented 5 years ago

I think using iCloud to sync playback position and the tiny amount of Library data between devices would be much welcome. Especially when the iPad version in #230 comes along.

Since we already support dead simple file sharing since #66 was added in 3.2.0 we don't have to sync files at all. While some people will find that too much manual work, I would argue that having fine grained manual control over the synced files without additional interface is enough of a advantage. We could also introduce a sharing option to the batch edit, allowing people to select their whole library for sharing/sync.

The most important thing for me would be proper sync of the playback position, as fast and accurate as possible.

GianniCarlo commented 5 years ago

Agreed, this would be the next step, iCloud sync to provide an audible-like experience of having the metadata of your library/account synced to all your devices. After this one we'll figure out what to do with the files

ryantstone commented 5 years ago

CloudKit would be a good way to handle this. It can mirror CoreData and handle even syncing of files. I have a little bit of experience with CloudKit.

GianniCarlo commented 5 years ago

πŸ‘Œ it'd be great if you want to tackle it @ryantstone . I was thinking too that we should add an entity that references an account or profile, so we can store there the user's settings that we're currently storing in UserDefaults

dontcrash commented 4 years ago

Any update :)?

GianniCarlo commented 4 years ago

this is the main focus for BookPlayer in 2020, problem is, I haven't had much free time these last few months to put into BookPlayer, so it's slooowly moving forward :/

dontcrash commented 4 years ago

this is the main focus for BookPlayer in 2020, problem is, I haven't had much free time these last few months to put into BookPlayer, so it's slooowly moving forward :/

I haven’t had a chance to look over the code yet, but in some instances it is almost as simple as replacing NSPersistentContainer with NSPersistentCloudKitContainer (in AppDelegate) and then minor setup on the Apple Developer site

GianniCarlo commented 4 years ago

I haven checked yet about CloudKit tbh, we were first reworking how we process our files, to have a 1:1 representation of the imported folder structure instead of what we're doing right now.

But if it's as simple as you put it, I'll give it a go πŸ€”

GianniCarlo commented 2 years ago

An update on this issue, we did try CloudKit, and while syncing the CoreData database works automagically most of the time, moving the audio files would still need to be a manual process, otherwise we would need to use the user's storage space in iCloud for BookPlayer, possibly taking up double space for those that use iCloud as their cloud provider. For tech-savvy users, this won't be a problem, but for the rest of the users, it would be very confusing not being able to continue playback on their other devices due to files requiring to be imported (via airdrop maybe) from their main device

So to simplify things, we'll be rolling out our own sync service (it'll be open source as well), that will include syncing the audio files as well as the library progress to cover the needs of the basic user. After that we can look into more advanced options, like customizing the cloud destination from within the app, to where the user would like to sync the library progress (and/or files), and also whether they want to upload the audio files as well or not

cc @ynunezaguirre

skobylite commented 2 years ago

Very excited about this feature - have you been able to make any progress on this?

GianniCarlo commented 2 years ago

@skobylite all our progress is in the uploaded branch v5.0.0, we've managed to upload the entire library of the app, but we're still in the process of implementing syncing progress and keeping it up to date on multiple devices. No ETA yet on when a beta could be available though :/

skobylite commented 2 years ago

Amazing! Exciting to hear this, you guys are setting a precedent for this functionality - Apple books sync is unreliable

earnestma commented 2 years ago

@GianniCarlo Would it also be possible to offload books + bookmarks & notes to the cloud only? I don't have a lot of space left on my phone, but would like to keep the bookmarks available in that way as well

GianniCarlo commented 2 years ago

@earnestma both are planned for, but possibly the first version of the sync will not contain offloading, as the main focus is right now in keeping both the library hierarchy synced (including bookmarks and notes) and the progress as well

tom-kaufman commented 1 year ago

Any updates on this? :)

GianniCarlo commented 1 year ago

yes! v5.0.0 will have offloading of the book files, and streaming available too (well the correct term is 'progressive downloading' or pseudo streaming, as otherwise we would need to adopt HLS and process and convert all the audio files which is a heavy operation with audiobooks, but it works just as well 😁), we're currently gearing towards release, I'll start closing all the open tickets releated to v5.0.0 once the app is live and I've merged the release PR

GianniCarlo commented 1 year ago

v5.0.0 is finally released, there are big fundamental changes on how the app works, so we'll be checking if any issues come up that need to be addressed

skobylite commented 1 year ago

v5.0.0 is finally released, there are big fundamental changes on how the app works, so we'll be checking if any issues come up that need to be addressed

Amazing work Gianni πŸ‘Š so this feature is live now? Is there some documentation on using it?

GianniCarlo commented 1 year ago

thanks @skobylite !, no documentation yet, but will get to it after solving all the v5 launch critical issues πŸ˜…. But the main gist of it, is that once you subscribe, all the library items are queued up to be uploaded one at a time, all subsequent updates to the items (progress or hierarchy) are queued up too, so the actions on the backend are executed in the same order, and the data is updated correctly. We haven't open sourced the backend yet, but will get to that after we iron out any issues we find on it after more time of usage

tom-kaufman commented 1 year ago

@GianniCarlo I want to make a desktop app that I can sync with BookPlayer. Would that be feasible once you open source the backend?

GianniCarlo commented 1 year ago

@tom-kaufman yes definitely, the only external requirement would be the Sign In with Apple, as we rely on that token to decode the shared email for signup and subsequent requests for the auth bearer token, which won't be a problem on MacOS, but to be honest I haven't checked on Windows how's the landscape for Sign In with Apple usage, I know it's available via web technologies though πŸ€”