Skip to content

Commit 988749d

Browse files
authored
Feature: Added iCloud Drive and Photos detection (#10819)
1 parent 52a6858 commit 988749d

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

src/Files.App/Filesystem/Cloud/Detector/AppleCloudDetector.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/Files.App/Filesystem/Cloud/Detector/CloudDetector.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ private static IEnumerable<ICloudDetector> EnumerateDetectors()
2828
yield return new GoogleDriveCloudDetector();
2929
yield return new DropBoxCloudDetector();
3030
yield return new BoxCloudDetector();
31-
yield return new AppleCloudDetector();
3231
yield return new GenericCloudDetector();
3332
yield return new SynologyDriveCloudDetector();
3433
}

src/Files.App/Helpers/CloudDrivesDetector.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
7878
driveType = appName;
7979
}
8080

81+
// iCloud specific
82+
if (driveType.StartsWith("iCloudDrive"))
83+
driveType = "iCloudDrive";
84+
if (driveType.StartsWith("iCloudPhotos"))
85+
driveType = "iCloudPhotos";
86+
8187
using var bagKey = clsidSubKey.OpenSubKey(@"Instance\InitPropertyBag");
8288
var syncedFolder = (string)bagKey?.GetValue("TargetFolderPath");
8389
if (syncedFolder is null)
@@ -92,6 +98,8 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
9298
"Amazon Drive" => CloudProviders.AmazonDrive,
9399
"Nextcloud" => CloudProviders.Nextcloud,
94100
"Jottacloud" => CloudProviders.Jottacloud,
101+
"iCloudDrive" => CloudProviders.AppleCloudDrive,
102+
"iCloudPhotos" => CloudProviders.AppleCloudPhotos,
95103
_ => null,
96104
};
97105
if (driveID is null)
@@ -108,6 +116,8 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
108116
CloudProviders.AmazonDrive => $"Amazon Drive",
109117
CloudProviders.Nextcloud => !string.IsNullOrEmpty(nextCloudValue) ? nextCloudValue : "Nextcloud",
110118
CloudProviders.Jottacloud => $"Jottacloud",
119+
CloudProviders.AppleCloudDrive => $"iCloud Drive",
120+
CloudProviders.AppleCloudPhotos => $"iCloud Photos",
111121
_ => null
112122
},
113123
SyncFolder = syncedFolder,

src/Files.Shared/Cloud/CloudProviders.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ public enum CloudProviders
77
Mega,
88
GoogleDrive,
99
DropBox,
10-
AppleCloud,
10+
AppleCloudDrive,
11+
AppleCloudPhotos,
1112
AmazonDrive,
1213
Nextcloud,
1314
Yandex,

0 commit comments

Comments
 (0)