@@ -14,14 +14,17 @@ public class Settings
14
14
public string [ ] CustomSuffixes { get ; set ; } = Array . Empty < string > ( ) ;
15
15
public string [ ] CustomProtocols { get ; set ; } = Array . Empty < string > ( ) ;
16
16
17
- [ JsonIgnore ]
18
17
public Dictionary < string , bool > BuiltinSuffixesStatus { get ; set ; } = new Dictionary < string , bool > {
19
18
{ "exe" , true } , { "appref-ms" , true } , { "lnk" , true }
20
19
} ;
21
20
22
- [ JsonIgnore ]
23
21
public Dictionary < string , bool > BuiltinProtocolsStatus { get ; set ; } = new Dictionary < string , bool > {
24
- { $ "steam://run/{ SuffixSeparator } steam://rungameid/", true } , { "com.epicgames.launcher://apps/" , true } , { $ "http://{ SuffixSeparator } https://", false }
22
+ { "steam" , true } , { "epic" , true } , { "http" , false }
23
+ } ;
24
+
25
+ [ JsonIgnore ]
26
+ public Dictionary < string , string > BuiltinProtocols { get ; set ; } = new Dictionary < string , string > {
27
+ { "steam" , $ "steam://run/{ SuffixSeparator } steam://rungameid/" } , { "epic" , "com.epicgames.launcher://apps/" } , { "http" , $ "http://{ SuffixSeparator } https://"}
25
28
} ;
26
29
27
30
public bool UseCustomSuffixes { get ; set ; } = false ;
@@ -30,7 +33,7 @@ public class Settings
30
33
public string [ ] GetSuffixes ( )
31
34
{
32
35
List < string > extensions = new List < string > ( ) ;
33
- foreach ( var item in BuiltinSuffixesStatus )
36
+ foreach ( var item in BuiltinSuffixesStatus )
34
37
{
35
38
if ( item . Value )
36
39
{
@@ -60,10 +63,13 @@ public string[] GetProtocols()
60
63
{
61
64
if ( item . Value )
62
65
{
63
- var tmp = item . Key . Split ( SuffixSeparator , StringSplitOptions . RemoveEmptyEntries ) ;
64
- foreach ( var p in tmp )
66
+ if ( BuiltinProtocols . TryGetValue ( item . Key , out string ps ) )
65
67
{
66
- protocols . Add ( p ) ;
68
+ var tmp = ps . Split ( SuffixSeparator , StringSplitOptions . RemoveEmptyEntries ) ;
69
+ foreach ( var protocol in tmp )
70
+ {
71
+ protocols . Add ( protocol ) ;
72
+ }
67
73
}
68
74
}
69
75
}
0 commit comments