Skip to content

Commit c93a484

Browse files
committed
Remove old method
1 parent f79d4a7 commit c93a484

File tree

1 file changed

+3
-34
lines changed

1 file changed

+3
-34
lines changed

src/Files.App/Utils/Cloud/Detector/LucidLinkCloudDetector.cs

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,10 @@ public sealed class LucidLinkCloudDetector : AbstractCloudDetector
1515

1616
protected override async IAsyncEnumerable<ICloudProvider> GetProviders()
1717
{
18-
string jsonPath = Path.Combine(Constants.UserEnvironmentPaths.HomePath, ".lucid", "app.json");
19-
20-
// Lucid Link v3 and above
21-
if (!File.Exists(jsonPath))
22-
{
23-
string volumePath = Path.Combine(Constants.UserEnvironmentPaths.SystemDrivePath, "Volumes");
24-
await foreach (var provider in GetLucidLinkV3Providers(volumePath))
25-
{
26-
yield return provider;
27-
}
28-
}
29-
30-
var configFile = await StorageFile.GetFileFromPathAsync(jsonPath);
31-
using var jsonFile = JsonDocument.Parse(await FileIO.ReadTextAsync(configFile));
32-
var jsonElem = jsonFile.RootElement;
33-
34-
if (jsonElem.TryGetProperty("filespaces", out JsonElement filespaces))
18+
string volumePath = Path.Combine(Constants.UserEnvironmentPaths.SystemDrivePath, "Volumes");
19+
await foreach (var provider in GetLucidLinkV3Providers(volumePath))
3520
{
36-
foreach (JsonElement inner in filespaces.EnumerateArray())
37-
{
38-
string syncFolder = inner.GetProperty("filespaceName").GetString();
39-
40-
string[] orgNameFilespaceName = syncFolder.Split(".");
41-
string path = Path.Combine($@"{Constants.UserEnvironmentPaths.SystemDrivePath}\Volumes", orgNameFilespaceName[1], orgNameFilespaceName[0]);
42-
string filespaceName = orgNameFilespaceName[0];
43-
44-
StorageFile iconFile = await FilesystemTasks.Wrap(() => StorageFile.GetFileFromPathAsync(iconPath).AsTask());
45-
46-
yield return new CloudProvider(CloudProviders.LucidLink)
47-
{
48-
Name = $"Lucid Link ({filespaceName})",
49-
SyncFolder = path,
50-
IconData = iconFile is not null ? await iconFile.ToByteArrayAsync() : null,
51-
};
52-
}
21+
yield return provider;
5322
}
5423
}
5524

0 commit comments

Comments
 (0)