Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Select Drive folder to sync #26

Open
victante opened this issue Oct 29, 2019 · 2 comments
Open

Select Drive folder to sync #26

victante opened this issue Oct 29, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@victante
Copy link

Isn't it possible to select which folders of my Drive I'd like to sync? When I start the app it begin syncing everything, but I'd like to restrain it to a certain set of folders.
If this feature doesn't exist, is it possible to be implemented in the future?

Tnx!

@bcedu bcedu self-assigned this Oct 29, 2019
@bcedu bcedu added the enhancement New feature or request label Oct 29, 2019
@PhoneixS
Copy link

PhoneixS commented Mar 18, 2020

I think it shouldn't be so hard to have a very basic option. For example, if we only allow specifying a root folder in Google, the only addition to the logic could be:

if (f.mimeType == "application/vnd.google-apps.folder") {
                    // It's a directory. Check if we want to download it.
                    if (f.name == root_folder) { // This if is the added piece
                        // We want to have it, create it if doesn't exist
                        // Get it's id to get its files and download them if necessary
                        if (!this.local_file_exists(current_path+"/"+f.name)) this.create_local_file(f, current_path);
                        this.check_remote_files(current_path+"/"+f.name, f.id);
                    } else {
                        this.log_message(_("INFO: %s ignored as user requests only %s").printf(current_path+"/"+f.name, root_folder), 0);
                    }
                } else if (this.is_google_mime_type (f.mimeType)) {
...

Where root_folder comes from the settings.

I don't know Vala either how to make the GUI part so it's difficult for me to develop a good patch but I can help with the logic.

Note that with the above solution the folder can't have any subfolder that isn't named as itself. The best way to do it could be to have a regex checked against the full path current_path+"/"+f.name, that would allow things like '/folder/other/*' to download all folders recursively under '/folder/other'. And maybe another option for files would be a nice addition too.

WARNING The adding elements to the library must include the condition or it will try to delete remote files that weren't synchronized. For example, check that the file is inside the root_folder before adding it to the library.

@lucasmartins
Copy link

A .ignore would suffice, no GUI needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants