Open nojohnso opened 5 years ago
The plan is to eventually support the WebDAV protocol which will allow syncing with various cloud services including NextCloud/ownCloud and Dropbox. There isn't any ETA on it but it will likely be the first thing I work on after a stable release (maybe before, not sure yet).
For now, I've heard of a few cases where users have had success using Syncthing between different systems. You can sync the folder at #151 for your respective systems and should see it update across devices.
just to say a webdav sync function would be awesome!
WebDAV seems like the most elegant solution for this. Then perhaps an integration for NewPipe could also be made as discussed in #1026. I just want to point out that the user @T-vK already started developing this a while back, but doesn't seem to have opened a PR for it: https://github.com/TeamNewPipe/NewPipe/issues/1163#issuecomment-713482853 The code he wrote: https://github.com/T-vK/FreeTube/commit/1df250538cda1163bcdd0cc6f2d8731b869ff483
Oh please, I'd love to see this working, too! :-D This is one one the last parts for me to get rid off Google Services on phones and computers at home <3
Just chiming in, sync would be amazing. NewPipe to FT and FT to FT.
https://www.npmjs.com/package/webdav seems like a good option. Would need to find a way to keep passwords secure and not stored as plaintext on the user's system or only use oAuth
can't wait for this!
WebDAV sync would be great! :+1:
Until webdav or any tools provided by FreeTube, I started FreeTube Sync.
The role of the server is to store the history, the playlists and the profiles of FreeTube instances (clients).
After starting the server, each client must initialize their local datas on the server. This action must be processed only once. At each time you want to use FreeTube, you have to pull datas from the server before. A watcher will push updates on the server when your history, your playlists or your profiles are updated. When FreeTube is restarted, history, playlists and profiles will be updated.
@simmstein I would highly recommend removing the watcher while FreeTube is running unless you want your files to get corrupted. While FreeTube is running it is meant to be the only program accessing the files and while it is running the files should be considered incomplete. While FreeTube is running it uses an append-only format to avoid having to waste disk writes rewriting the whole file every time, only when all FreeTube windows have been closed and it has finished cleaning up the databases should they be considered clean and syncable. With your sync while running approach, if you were to have FreeTube open on multiple computers at the same time, you would be very likely to encounter dataloss or odd behaviour from FreeTube (if the databases are too corrupted the app intentionally refuses to start to avoid corrupting them any further).
We really need to find a way to lock the files at the operating system level like other programs do, so people stop messing around with the files while FreeTube is running.
The sync is clever than just dectect an update and push to the server. And databases are never rewrite when freetube is running because data is Pull is processed before freetube start.
I can't stop you from doing what you want to do, but please make sure it is clear to your users that if anything happens to their databases while using your tool they should go to you for support, not us (FreeTube team).
Example of a case that could cause problems:
It would be better if the sync tool worked like this:
My tool does not save plain file, it's a sqlite database. Pushed datas are validated in client and server side. I also analyse how freetube files are updated while freetube is running or is stopped. It does not mean that it's perfect but corrupted data seems quite impossible.
As mentioned above, if any user has any issues using your tool, make sure they know they need to come to you. Please add a disclaimer to your README or something like that makes it clear that it has nothing to do with the FreeTube team, removing FreeTube from the name would also make it obvious that it's not associated.
The only officially supported way to sync your data between FreeTube installs is exporting and importing in the Data Settings in FreeTube.
@simmstein can you please make an android fork for your app to work with newpipe and/or FreeTubeAndroid
Would love to be able to do cross-device sync, particularly via SyncThing.
I can see webdav support being useful, but I'd like to suggest an (automated) JSON / plain text file synchronization target as well so it can work with non-cloud sync options (such as SyncThing).
I do see there is a workaround referenced above (#151), but it seems like syncing the database files would have the same concurrency risks as simmstein's method...? Additionally, resolving sync conflicts with binary files tends to be quite painful.
I personally don't see the need for webdav, it's not the greatest protocol around. I use Resilio sync and if one would use dropbox or syncthing it could all work, if there would be a way that freetube could handle the overwrite of json files (an update coming from a different source) whilst running.
Also, it might be best for each freetube instance to write to its own json inside a particular folder, and the active freetube instance reads/watches all json files in the target folder to look for changes. This way there would not be sync conflicts if two freetube instances are watching things at the same time (ie: music playing in living room while watching content in office, etc), or devices get disconnected from network temporarily, etc.
If this doesn't exist already, I'd love to see a subscription file that was always updated with any changes and the ability to save to a chosen location. It would make for an easy way to keep subs synced across devices using something like ownCloud.