Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

folder sync (or a way to do this) #157

Open
simonfossom opened this issue Jun 7, 2024 · 5 comments
Open

folder sync (or a way to do this) #157

simonfossom opened this issue Jun 7, 2024 · 5 comments

Comments

@simonfossom
Copy link

If there's photo upload, could you expand feautre to selected folder to backup files to the cloud (and desktop)?

Uploading photos is nice, but those are far from the most important files to sync. :)

@TheRedSpy15
Copy link
Owner

Definitely planned, but maybe some time. It's something that requires a different implementation for each platform.

The biggest roadblock: Android permissions. it would require the manage all files permission to access non media files without the user manually selecting them. Sadly, the Playstore would not see the feature as a "core" part of the app. Prohibiting the permission. Making this an Fdroid only feature.

The desktop clients also can't make use of background tasks like phones do. So those would need an entirely new implementation just for them. This is actually something that can be done luckily.

In the meantime, I do plan on expanding the current photo sync feature. Such as selecting multiple folders to sync and choose where in the cloud they are stored. I also would like to optionally scan recursively for files

@simonfossom
Copy link
Author

Hmm... Are you sure? Because what I've seen is that apps ask request for a specific folder.
User can approve one or more and it's not a big deal. It could be just Blaze folder in which user can drop files or they could allow sync on some other folders.

check this out: https://www.perplexity.ai/search/does-playstore-allow-LDWrsSp1QlSVxddR3aZG4Q#2

@TheRedSpy15
Copy link
Owner

Link gives error "could not view thread"

It is possible. But it wouldn't be any different than the current implementation without the MANAGE_EXTERNAL_STORAGE permission. Currently, we can sync media only (photos, videos, music)

https://developer.android.com/training/data-storage/manage-all-files

Unfortunately, using that permission would prohibit the update from being released on the playstore

Other apps that are using it on the playstore are doing so as Google's app review team has determined that permission is absolutely necessary for this app. It would not be in this case

@simonfossom
Copy link
Author

Sorry for the dead link.

This is what I was thinking: https://developer.android.com/training/data-storage/shared/documents-files#grant-access-directory

File management and media-creation apps typically manage groups of files in a directory hierarchy. To provide this capability in your app, use the ACTION_OPEN_DOCUMENT_TREE intent action, which allows the user to grant access to an entire directory tree, with some exceptions starting in Android 11 (API level 30). Your app can then access any file in the selected directory and any of its sub-directories.

When using ACTION_OPEN_DOCUMENT_TREE, your app gains access only to the files in the directory that the user selects. You don't have access to other apps' files that reside outside this user-selected directory. This user-controlled access allows users to choose exactly what content they're comfortable sharing with your app.

Correct me if I'm wrong but this is different from MANAGE_EXTERNAL_STORAGE

If this is not working, maybe you can publish in form of an addon full sync on fdroid or github.

@TheRedSpy15
Copy link
Owner

TheRedSpy15 commented Jun 11, 2024

I apologize for the delay in responding, however

ACTION_OPEN_DOCUMENT_TREE is already being implemented in the file_picker package, which we are currently using

The permission issue is sadly not very well documented, and I don't know if it's just an Android 14 change, or has always been this way since the SAF push. But we can gain access to files in a directory that the user provides access to. Which is what we currently do with the existing sync implementation. Just only media files

I suspect this is why I have not been able to find a single cloud provider, other than maybe Google itself, that supports automatic uploads outside of photos/videos

Now I will say on the positive side of things. The above only affects our ability to upload. I am now starting the process of implementing a system for the user to select folders that will automatically download their contents and stay synced (one way)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants