@calmh @ AudriusButkevicius I have now implemented selective and on-demand file syncing using .stignore
. Basically upon adding a folder the app writes an .stignore
file that looks like this:
*
This appears to have the same effect as stalling the puller: there is nothing to be synced. (I assume the client may also show up on other nodes as ‘Synchronized’ but haven’t checked) I can subsequently still download ignored files using the RequestGlobal
method.
For selective syncing, the app writes exclusion rules in the .stignore
file like this:
!/some/file/i/want-locally.txt
!/some/dir/i/want
*
This would cause specific files to be synced while the rest is still ignored. The app would need to do some housekeeping (remove rules that do not match any global files, perhaps offer a way to delete and deselect a file in one action) and show appropriate UI (download file, ‘keep file synced’).
An additional advantage is that the only change needed to the syncthing code for this is the exposure of ‘RequestGlobal’ for on-demand downloading. (The alternative for this would be to call BringToFront after unignoring a file and then waiting for the file to sync, but this would preclude e.g. on-demand streaming of media.). It would also be easier to offer both send-receive and receive-only.
Do you see any downsides with this approach?