Skip to content

Commit a1f1401

Browse files
authored
Feature: Added detection for Seadrive cloud (#10977)
1 parent fff6e2b commit a1f1401

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/Files.App/Helpers/CloudDrivesDetector.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/Files.Shared/Cloud/CloudProviders.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public enum CloudProviders
1717
SynologyDrive,
1818
pCloud,
1919
AdobeCreativeCloud,
20-
Nutstore
20+
Nutstore,
21+
Seadrive
2122
}
2223
}

0 commit comments

Comments
 (0)