File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -275,12 +275,14 @@ public static string GetVersion()
275
275
var strlen = reader . ReadInt32 ( ) ;
276
276
var strbytes = reader . ReadBytes ( strlen ) ;
277
277
278
- var version = Encoding . UTF8 . GetString ( strbytes ) ;
278
+ // TODO: should cache this
279
+ public static async Task < List < string > > GetVersionsList ( )
280
+ {
281
+ var resp = await HttpClient . GetAsync ( Utils . Constants . BeatModsVersions ) ;
282
+ var body = await resp . Content . ReadAsStringAsync ( ) ;
283
+ List < string > versions = JsonSerializer . Deserialize < string [ ] > ( body ) . ToList ( ) ;
279
284
280
- //There is one version ending in "p1" on BeatMods
281
- var filteredVersionMatch = Regex . Match ( version , @"[\d]+.[\d]+.[\d]+(p1)?" ) ;
282
- return filteredVersionMatch . Success ? filteredVersionMatch . Value : version ;
283
- }
285
+ return versions ;
284
286
}
285
287
286
288
public static string GetOculusDir ( )
Original file line number Diff line number Diff line change @@ -114,7 +114,9 @@ private async void LoadVersionsAsync()
114
114
{
115
115
try
116
116
{
117
- var resp = await HttpClient . GetAsync ( Utils . Constants . BeatModsVersions ) ;
117
+ var versions = await Utils . GetVersionsList ( ) ;
118
+
119
+ var resp = await HttpClient . GetAsync ( Utils . Constants . BeatModsAlias ) ;
118
120
var body = await resp . Content . ReadAsStringAsync ( ) ;
119
121
List < string > versions = JsonSerializer . Deserialize < string [ ] > ( body ) . ToList ( ) ;
120
122
You can’t perform that action at this time.
0 commit comments