From 03fefa33fed5fb69be71a53d9a46635f3348adca Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Thu, 19 Jun 2025 11:41:04 +0200 Subject: [PATCH] update AppUpdate to support linux updates --- ModpackUpdater.Apps.Client/AppUpdater.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ModpackUpdater.Apps.Client/AppUpdater.cs b/ModpackUpdater.Apps.Client/AppUpdater.cs index ffc6350..c33e715 100644 --- a/ModpackUpdater.Apps.Client/AppUpdater.cs +++ b/ModpackUpdater.Apps.Client/AppUpdater.cs @@ -2,6 +2,7 @@ using Newtonsoft.Json.Converters; using Pilz.Extensions; using System.Reflection; +using System.Runtime.InteropServices; namespace ModpackUpdater.Apps.Client; @@ -12,9 +13,10 @@ public class AppUpdater [JsonConverter(typeof(VersionConverter))] public Version Version { get; set; } public string DownloadUrl { get; set; } + public string DownloadUrlLinux { get; set; } } - private const string UPDATE_URL = "https://git.pilzinsel64.de/gaming/minecraft/minecraft-modpack-updater/-/snippets/3/raw/main/updates.json"; + private const string UPDATE_URL = "https://git.pilzinsel64.de/pilzinsel64/minecraft-modpack-updater/-/snippets/3/raw/main/updates.json"; private readonly HttpClient httpClient = new(); private UpdateInfo info; @@ -60,7 +62,8 @@ public class AppUpdater Stream downloadStream = null; try { - downloadStream = await client.GetStreamAsync(info.DownloadUrl); + var url = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? info.DownloadUrlLinux : info.DownloadUrl; + downloadStream = await client.GetStreamAsync(url); await downloadStream.CopyToAsync(tempFileStream); } catch