@@ -26,6 +26,7 @@ public static async Task<IEnumerable<ICloudProvider>> DetectCloudDrives()
2626 SafetyExtensions . IgnoreExceptions ( DetectYandexDisk , App . Logger ) ,
2727 SafetyExtensions . IgnoreExceptions ( DetectpCloudDrive , App . Logger ) ,
2828 SafetyExtensions . IgnoreExceptions ( DetectNutstoreDrive , App . Logger ) ,
29+ SafetyExtensions . IgnoreExceptions ( DetectSeadriveDrive , App . Logger ) ,
2930 } ;
3031
3132 await Task . WhenAll ( tasks ) ;
@@ -269,5 +270,27 @@ private static Task<IEnumerable<ICloudProvider>> DetectNutstoreDrive()
269270
270271 return Task . FromResult < IEnumerable < ICloudProvider > > ( results ) ;
271272 }
273+
274+ private static Task < IEnumerable < ICloudProvider > > DetectSeadriveDrive ( )
275+ {
276+ var results = new List < ICloudProvider > ( ) ;
277+ using var SeadriveKey = Registry . CurrentUser . OpenSubKey ( @"Software\SeaDrive\Seafile Drive Client\Settings" ) ;
278+
279+ var syncFolder = ( string ) SeadriveKey ? . GetValue ( "seadriveRoot" ) ;
280+ if ( SeadriveKey is not null )
281+ {
282+ string iconPath = Path . Combine ( programFilesFolder , "SeaDrive" , "bin" , "seadrive.exe" ) ;
283+ var iconFile = Win32API . ExtractSelectedIconsFromDLL ( iconPath , new List < int > ( ) { 101 } ) . FirstOrDefault ( ) ;
284+
285+ results . Add ( new CloudProvider ( CloudProviders . Seadrive )
286+ {
287+ Name = $ "Seadrive",
288+ SyncFolder = syncFolder ,
289+ IconData = iconFile ? . IconData
290+ } ) ;
291+ }
292+
293+ return Task . FromResult < IEnumerable < ICloudProvider > > ( results ) ;
294+ }
272295 }
273296}
0 commit comments