manager: migrate base project structure & deps

This commit is contained in:
2025-11-10 18:28:20 +01:00
parent da25510543
commit 6cf27b4867
28 changed files with 304 additions and 155 deletions

View File

@@ -6,25 +6,25 @@ namespace ModpackUpdater;
public class ModpackConfig
{
public bool Maintenance { get; set; }
public string Name { get; set; }
public string UpdateUrl { get; set; }
public string InstallUrl { get; set; }
public string UnleashApiUrl { get; set; }
public string UnleashInstanceId { get; set; }
public string? Name { get; set; }
public string? UpdateUrl { get; set; }
public string? InstallUrl { get; set; }
public string? UnleashApiUrl { get; set; }
public string? UnleashInstanceId { get; set; }
public bool PreferDirectLinks { get; set; }
public string MinecraftVersion { get; set; }
public string RefTag { get; set; }
public string? MinecraftVersion { get; set; }
public string? RefTag { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public ModLoader ModLoader { get; set; }
[JsonIgnore]
public string ConfigUrl { get; private set; }
public string? ConfigUrl { get; private set; }
public static ModpackConfig LoadFromUrl(string url)
public static ModpackConfig LoadFromUrl(string? url)
{
var result = new HttpClient().GetStringAsync(url).Result;
var config = JsonConvert.DeserializeObject<ModpackConfig>(result);
var config = JsonConvert.DeserializeObject<ModpackConfig>(result) ?? new();
config.ConfigUrl = url;
return config;
}