Skip to content

Commit 82dee07

Browse files
authored
Feature: Added support for ownCloud drive (#12896)
1 parent 14bde3d commit 82dee07

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Files.App/Utils/Cloud/CloudDrivesDetector.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
8686
driveType = appName;
8787
}
8888

89-
// iCloud specific
89+
// Drive specific
9090
if (driveType.StartsWith("iCloudDrive"))
9191
driveType = "iCloudDrive";
9292
if (driveType.StartsWith("iCloudPhotos"))
9393
driveType = "iCloudPhotos";
94+
if (driveType.StartsWith("ownCloud"))
95+
driveType = "ownCloud";
9496

9597
using var bagKey = clsidSubKey.OpenSubKey(@"Instance\InitPropertyBag");
9698
var syncedFolder = (string)bagKey?.GetValue("TargetFolderPath");
@@ -109,6 +111,7 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
109111
"iCloudDrive" => CloudProviders.AppleCloudDrive,
110112
"iCloudPhotos" => CloudProviders.AppleCloudPhotos,
111113
"Creative Cloud Files" => CloudProviders.AdobeCreativeCloud,
114+
"ownCloud" => CloudProviders.ownCloud,
112115
_ => null,
113116
};
114117
if (driveID is null)
@@ -117,6 +120,8 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
117120
}
118121

119122
string nextCloudValue = (string)namespaceSubKey?.GetValue(string.Empty);
123+
string ownCloudValue = (string)clsidSubKey?.GetValue(string.Empty);
124+
120125
results.Add(new CloudProvider(driveID.Value)
121126
{
122127
Name = driveID switch
@@ -128,6 +133,7 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
128133
CloudProviders.AppleCloudDrive => $"iCloud Drive",
129134
CloudProviders.AppleCloudPhotos => $"iCloud Photos",
130135
CloudProviders.AdobeCreativeCloud => $"Creative Cloud Files",
136+
CloudProviders.ownCloud => !string.IsNullOrEmpty(ownCloudValue) ? ownCloudValue : "ownCloud",
131137
_ => null
132138
},
133139
SyncFolder = syncedFolder,

src/Files.Shared/Cloud/CloudProviders.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public enum CloudProviders
2222
AdobeCreativeCloud,
2323
Nutstore,
2424
Seadrive,
25-
Autodesk
25+
Autodesk,
26+
ownCloud,
2627
}
2728
}

0 commit comments

Comments
 (0)