diff --git a/src/Files.App/Utils/Cloud/CloudProviders.cs b/src/Files.App/Utils/Cloud/CloudProviders.cs index 5b9d208e1797..ea88038a66b8 100644 --- a/src/Files.App/Utils/Cloud/CloudProviders.cs +++ b/src/Files.App/Utils/Cloud/CloudProviders.cs @@ -45,6 +45,8 @@ public enum CloudProviders LucidLink, - kDrive + kDrive, + + SyncDrive } } diff --git a/src/Files.App/Utils/Cloud/Detector/CloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/CloudDetector.cs index 85ce72308320..5342f26a3934 100644 --- a/src/Files.App/Utils/Cloud/Detector/CloudDetector.cs +++ b/src/Files.App/Utils/Cloud/Detector/CloudDetector.cs @@ -34,6 +34,7 @@ private static IEnumerable EnumerateDetectors() yield return new GenericCloudDetector(); yield return new SynologyDriveCloudDetector(); yield return new LucidLinkCloudDetector(); + yield return new SyncCloudDetector(); } } } diff --git a/src/Files.App/Utils/Cloud/Detector/SyncCloudDetector.cs b/src/Files.App/Utils/Cloud/Detector/SyncCloudDetector.cs new file mode 100644 index 000000000000..b3eb3c87701c --- /dev/null +++ b/src/Files.App/Utils/Cloud/Detector/SyncCloudDetector.cs @@ -0,0 +1,31 @@ +using System.IO; +using Windows.Storage; + +namespace Files.App.Utils.Cloud +{ + /// + /// Provides a utility for Sync Cloud detection. + /// + public sealed class SyncCloudDetector : AbstractCloudDetector + { + protected override async IAsyncEnumerable GetProviders() + { + string syncFolderPath = Path.Combine(Constants.UserEnvironmentPaths.HomePath, "Sync"); + + if (Directory.Exists(syncFolderPath)) + { + foreach (string directory in Directory.GetDirectories(syncFolderPath)) + { + var folder = await StorageFolder.GetFolderFromPathAsync(directory); + + yield return new CloudProvider(CloudProviders.SyncDrive) + { + Name = $"Sync - {folder.Name}", + SyncFolder = directory, + // IconData = (needs icon) + }; + } + } + } + } +}