load modpack info before modpack installer

This commit is contained in:
2024-06-20 15:05:01 +02:00
parent 604d35856f
commit c97a04c4ce
6 changed files with 64 additions and 33 deletions

View File

@@ -9,9 +9,14 @@ public class ModpackConfig
public string UpdateUrl { get; set; }
public string InstallUrl { get; set; }
[JsonIgnore]
public string ConfigUrl { get; set; }
public static ModpackConfig LoadFromUrl(string url)
{
string result = new HttpClient().GetStringAsync(url).Result;
return JsonConvert.DeserializeObject<ModpackConfig>(result);
var config = JsonConvert.DeserializeObject<ModpackConfig>(result);
config.ConfigUrl = url;
return config;
}
}