From 83c40ec4179a726c8eb03eda1662c24d182d8b65 Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner Date: Sat, 29 Jun 2024 19:05:41 +0200 Subject: [PATCH] Adjusted image conversion helper to be compatible with the latest egg changes --- .../Servers/Helpers/ImageConversionHelper.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Moonlight/Features/Servers/Helpers/ImageConversionHelper.cs b/Moonlight/Features/Servers/Helpers/ImageConversionHelper.cs index 2bfb0df2..840f5e1b 100644 --- a/Moonlight/Features/Servers/Helpers/ImageConversionHelper.cs +++ b/Moonlight/Features/Servers/Helpers/ImageConversionHelper.cs @@ -274,7 +274,17 @@ public class ImageConversionHelper // Node Regex: As the online detection uses regex, we want to escape any special chars from egg imports // as eggs dont use regex and as such may contain characters which regex uses as meta characters. // Without this escaping, many startup detection strings wont work - result.OnlineDetection = Regex.Escape(startup["done"]?.Value() ?? "Online detection was missing"); + + // As pelican/pterodactyl changed their image format AGAIN, there needs to be the check below + var val = startup["done"]!; + string rawDone; + + if (val is JArray array) + rawDone = array.First().Value() ?? "Online detection was missing"; + else + rawDone = val.Value() ?? "Online detection was missing"; + + result.OnlineDetection = Regex.Escape(rawDone); // Docker images