bpozdena / OneDriveGUI

A simple GUI for OneDrive Linux client with multi-account support.
GNU General Public License v3.0
706 stars 33 forks source link

Rclone import #103

Open roleohibachi opened 1 year ago

roleohibachi commented 1 year ago

In support of #102, this implements:

If an rclone onedrive remote is provided, a new config is created (largely reusing code from the "create config" page). The drive_id is taken from rclone. The refresh_token is also taken, since it belongs to the same user, and written to the refresh_token file. Information on the this rclone feature is here.

If an rclone alias remote is provided, it is split into the "real remote" (which should be a onedrive, and is used to populate the import function) and the path that was aliased. The path is then listed in the sync_list file, which will include only that path in sync. Information on this rclone feature is here. I feel there should be more error handling here, but I'm not sure what failure cases would look like.

Decision for maintainers: whether to use the rclone "remote_name" as the new profile's name, or whether to use the user-provided value.

Here is a sample rclone.conf (with realistic, but bogus, values). rclone.conf.txt