Skip to content

Add support for Synology Drive Client #9188

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

Merged
merged 4 commits into from
Jun 8, 2022

Conversation

BanCrash
Copy link
Contributor

@BanCrash BanCrash commented May 16, 2022

Resolved / Related Issues
Items resolved / related issues by this PR.

Details of Changes

  • Added support for Synology Drive Client, based on GoogleCloud provider.

NOTE: I never used Synology Drive Client for sync before, just for backups, so while in my tests it's working I can't assure it will work for all scenarios since I had to figure out how the information is stored on the database, but maybe I figured it out wrong and it needs some readjustments. When this is added I would like to receive feedback from the users to check if it's working for them too.

Validation

  • Built and ran the app
  • Tested the changes for accessibility

Screenshots (optional)
image

image

@gave92
Copy link
Member

gave92 commented May 21, 2022

Hi, I don't have the possibility to test this, but out of curiosity could you check if in registry under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\ there is any subkey related to Synology folders?

@BanCrash
Copy link
Contributor Author

Hi, I don't have the possibility to test this, but out of curiosity could you check if in registry under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\ there is any subkey related to Synology folders?

There is one, but just for showing the name of the server, nothing about the folders:

image

Feel free to ask any other thing you think of.

@gave92
Copy link
Member

gave92 commented May 22, 2022

Thanks, I'm asking because that's where Cloud drives that integrate with Explorer register themselves (and indeed you've found Synology).
If you were to take the key name that has the reference to Synology (by key name I mean the "folder" name, below highlighted for Onedrive) and search under HKEY_CLASSES_ROOT\CLSID\ you should find the same GUID with info about the synced folder (path would be HKEY_CLASSES_ROOT\CLSID\{<SYNOLOGY_GUID>}\Instance\InitPropertyBag).

This is what we do to detect a few cloud drives (OneDrive, Box, iCloudDrive, Dropbox, Nextcloud, MEGA, Amazon Drive).
*Note: I have nothing against parsing the database, I'm just curious if the above would work for synology too.

@BanCrash
Copy link
Contributor Author

Thanks, I'm asking because that's where Cloud drives that integrate with Explorer register themselves (and indeed you've found Synology). If you were to take the key name that has the reference to Synology (by key name I mean the "folder" name, below highlighted for Onedrive) and search under HKEY_CLASSES_ROOT\CLSID\ you should find the same GUID with info about the synced folder (path would be HKEY_CLASSES_ROOT\CLSID\{<SYNOLOGY_GUID>}\Instance\InitPropertyBag).

This is what we do to detect a few cloud drives (OneDrive, Box, iCloudDrive, Dropbox, Nextcloud, MEGA, Amazon Drive). *Note: I have nothing against parsing the database, I'm just curious if the above would work for synology too.

It seems that it only has a shortcut to a folder that have inside the last folder added, but that seems normal since in Windows file explorer for some reason it only shows the last created sync task:

image

image

However, as I suspected conn_id could have multiple values, now my new sync tasks have a 3, so they are not getting detected. I will do more tests and check the database to see if I can found how to know if a task is a backup task or a sync task.

Now it should work with any database. Also added server name to the folder name
@BanCrash
Copy link
Contributor Author

Ok, now it should work in each database. I got the connection id for other database, and in that database there is connection_type for knowing if a connection is for sync or for backup.

I also added the host name to the drive folder as Windows does.

BTW, Files shows all synced folders while Windows only shows the last one:

image

image

@BanCrash BanCrash marked this pull request as ready for review May 23, 2022 08:59
@gave92
Copy link
Member

gave92 commented Jun 4, 2022

@BanCrash made a couple of small changes (replaced SynologyDriveConnection with a Tuple, skip invalid entries instead of returning no results). Hopefully I haven't broken anything. If you agree with the changes, this looks good.

@gave92 gave92 self-requested a review June 4, 2022 11:50
@gave92 gave92 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Jun 4, 2022
Copy link
Contributor Author

@BanCrash BanCrash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you! Just tested and still working as expected.

@yaira2 yaira2 changed the title [Post 2.3] Add support for Synology Drive Client Add support for Synology Drive Client Jun 8, 2022
@yaira2 yaira2 merged commit c29af5c into files-community:main Jun 8, 2022
@yaira2 yaira2 mentioned this pull request Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synology Drive Client
3 participants