Repository: files-community/Files
File: src/Files.App/Utils/Cloud/CloudDrivesDetector.cs (C#)

Code before:
					using var namespaceSubKey = namespaceKey.OpenSubKey(subKeyName);
					var driveType = (string)namespaceSubKey?.GetValue(string.Empty);
					if (driveType is null)
					{
						continue;
					}

					//Nextcloud specific
					var appName = (string)namespaceSubKey?.GetValue("ApplicationName");
					if (!string.IsNullOrEmpty(appName) && appName == "Nextcloud")
					{
						driveType = appName;
					}

					// Drive specific
					if (driveType.StartsWith("iCloudDrive"))
						driveType = "iCloudDrive";
					if (driveType.StartsWith("iCloudPhotos"))
						driveType = "iCloudPhotos";
					if (driveType.StartsWith("ownCloud"))
						driveType = "ownCloud";
					if (driveType.StartsWith("ProtonDrive"))
						driveType = "ProtonDrive";

					using var bagKey = clsidSubKey.OpenSubKey(@"Instance\InitPropertyBag");
					var syncedFolder = (string)bagKey?.GetValue("TargetFolderPath");
					if (syncedFolder is null)
					{
						continue;
					}

					// Also works for OneDrive, Box, Dropbox
					CloudProviders? driveID = driveType switch
					{
						"MEGA" => CloudProviders.Mega,
						"Amazon Drive" => CloudProviders.AmazonDrive,
						"Nextcloud" => CloudProviders.Nextcloud,
						"Jottacloud" => CloudProviders.Jottacloud,
						"iCloudDrive" => CloudProviders.AppleCloudDrive,
						"iCloudPhotos" => CloudProviders.AppleCloudPhotos,
						"Creative Cloud Files" => CloudProviders.AdobeCreativeCloud,
						"ownCloud" => CloudProviders.ownCloud,
						"ProtonDrive" => CloudProviders.ProtonDrive,
						"kDrive" => CloudProviders.kDrive,
						_ => null,
					};
					if (driveID is null)
					{
						continue;
					}


Review comment (suggestion):
Don't you have to add this?

```c#
if (driveType.StartsWith("kDrive"))
	driveType = "kDrive";
``` 

Code after:
				{
					using var namespaceSubKey = namespaceKey?.OpenSubKey(subKeyName);
					var driveIdentifier = (string?)namespaceSubKey?.GetValue(string.Empty);
					if (driveIdentifier is null)
						continue;

					var driveType = GetDriveType(driveIdentifier, namespaceSubKey, syncRootManagerKey);

					using var bagKey = clsidSubKey.OpenSubKey(@"Instance\InitPropertyBag");
					var syncedFolder = (string?)bagKey?.GetValue("TargetFolderPath");
					if (syncedFolder is null)
						continue;

					// Also works for OneDrive, Box, Dropbox
					CloudProviders? cloudProvider = driveType switch
					{
						"MEGA" => CloudProviders.Mega,
						"Amazon Drive" => CloudProviders.AmazonDrive,
						"Nextcloud" => CloudProviders.Nextcloud,
						"Jottacloud" => CloudProviders.Jottacloud,
						"iCloudDrive" => CloudProviders.AppleCloudDrive,
						"iCloudPhotos" => CloudProviders.AppleCloudPhotos,
						"Creative Cloud Files" => CloudProviders.AdobeCreativeCloud,
						"ownCloud" => CloudProviders.ownCloud,
						"ProtonDrive" => CloudProviders.ProtonDrive,
						"kDrive" => CloudProviders.kDrive,
						_ => null,
					};

					if (cloudProvider is null)
						continue;

					var nextCloudValue = (string?)namespaceSubKey?.GetValue(string.Empty);
					var ownCloudValue = (string?)clsidSubKey?.GetValue(string.Empty);
					var kDriveValue = (string?)clsidSubKey?.GetValue(string.Empty);

					using var defaultIconKey = clsidSubKey?.OpenSubKey(@"DefaultIcon");
					var iconPath = (string?)defaultIconKey?.GetValue(string.Empty);

					results.Add(new CloudProvider(cloudProvider.Value)
					{
						Name = cloudProvider switch
						{
							CloudProviders.Mega => $"MEGA ({Path.GetFileName(syncedFolder.TrimEnd('\\'))})",
							CloudProviders.AmazonDrive => $"Amazon Drive",
							CloudProviders.Nextcloud => !string.IsNullOrEmpty(nextCloudValue) ? nextCloudValue : "Nextcloud",
							CloudProviders.Jottacloud => $"Jottacloud",
							CloudProviders.AppleCloudDrive => $"iCloud Drive",
							CloudProviders.AppleCloudPhotos => $"iCloud Photos",
							CloudProviders.AdobeCreativeCloud => $"Creative Cloud Files",
							CloudProviders.ownCloud => !string.IsNullOrEmpty(ownCloudValue) ? ownCloudValue : "ownCloud",