File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ public enum CloudProviders
40
40
AppleCloud ,
41
41
AmazonDrive ,
42
42
Nextcloud ,
43
+ Yandex ,
43
44
Box
44
45
}
45
46
}
Original file line number Diff line number Diff line change @@ -16,14 +16,32 @@ public static async Task<List<CloudProvider>> DetectCloudDrives()
16
16
{
17
17
Extensions . IgnoreExceptions ( DetectOneDrive , Program . Logger ) ,
18
18
Extensions . IgnoreExceptions ( DetectSharepoint , Program . Logger ) ,
19
- Extensions . IgnoreExceptions ( DetectGenericCloudDrive , Program . Logger )
19
+ Extensions . IgnoreExceptions ( DetectGenericCloudDrive , Program . Logger ) ,
20
+ Extensions . IgnoreExceptions ( DetectYandexDisk , Program . Logger ) ,
20
21
} ;
21
22
22
23
await Task . WhenAll ( tasks ) ;
23
24
24
25
return tasks . Where ( o => o . Result != null ) . SelectMany ( o => o . Result ) . OrderBy ( o => o . ID . ToString ( ) ) . ThenBy ( o => o . Name ) . Distinct ( ) . ToList ( ) ;
25
26
}
26
27
28
+ private static Task < List < CloudProvider > > DetectYandexDisk ( )
29
+ {
30
+ var results = new List < CloudProvider > ( ) ;
31
+ using var yandexKey = Registry . CurrentUser . OpenSubKey ( @"SOFTWARE\Yandex\Yandex.Disk.2" ) ;
32
+ var syncedFolder = ( string ) yandexKey ? . GetValue ( "RootFolder" ) ;
33
+ if ( syncedFolder != null )
34
+ {
35
+ results . Add ( new CloudProvider ( )
36
+ {
37
+ ID = CloudProviders . Yandex ,
38
+ Name = $ "Yandex Disk",
39
+ SyncFolder = syncedFolder
40
+ } ) ;
41
+ }
42
+ return Task . FromResult ( results ) ;
43
+ }
44
+
27
45
private static Task < List < CloudProvider > > DetectGenericCloudDrive ( )
28
46
{
29
47
var results = new List < CloudProvider > ( ) ;
You can’t perform that action at this time.
0 commit comments