From 40b6432f0ffff2b041f3e1b229a7b49e1db01035 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Thu, 29 May 2025 14:56:30 +0200 Subject: [PATCH] Formatting --- app/MindWork AI Studio/Tools/Pandoc.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/MindWork AI Studio/Tools/Pandoc.cs b/app/MindWork AI Studio/Tools/Pandoc.cs index 6111f766..f622964f 100644 --- a/app/MindWork AI Studio/Tools/Pandoc.cs +++ b/app/MindWork AI Studio/Tools/Pandoc.cs @@ -34,7 +34,8 @@ public static partial class Pandoc return true; } - if (HasPandoc(installDir)) return true; + if (HasPandoc(installDir)) + return true; try { @@ -103,21 +104,18 @@ public static partial class Pandoc try { var subdirectories = Directory.GetDirectories(pandocDirectory); - foreach (var subdirectory in subdirectories) { var pandocPath = Path.Combine(subdirectory, "pandoc.exe"); if (File.Exists(pandocPath)) - { return true; - } } return false; } catch (Exception ex) { - LOG.LogInformation("Pandoc is not installed in the data directory and might have thrown and error:\n{ErrorMessage}", ex.Message); + LOG.LogInformation("Pandoc is not installed in the data directory and might have thrown and error: {0}", ex.Message); return false; } } @@ -207,17 +205,16 @@ public static partial class Pandoc if (!response.IsSuccessStatusCode) { - LOG.LogError("Code {StatusCode}: Could not fetch Pandoc's latest page:\n {Response}", response.StatusCode, response.RequestMessage); + LOG.LogError("Code {StatusCode}: Could not fetch Pandoc's latest page: {Response}", response.StatusCode, response.RequestMessage); await MessageBus.INSTANCE.SendWarning(new (Icons.Material.Filled.Warning, $"The latest pandoc version was not found, installing version {FALLBACK_VERSION.ToString()} instead.")); return FALLBACK_VERSION.ToString(); } var htmlContent = await response.Content.ReadAsStringAsync(); - var versionMatch = LatestVersionRegex().Match(htmlContent); if (!versionMatch.Success) { - LOG.LogError("The latest version regex returned nothing:\n {Value}", versionMatch.Groups.ToString()); + LOG.LogError("The latest version regex returned nothing: {Value}", versionMatch.Groups.ToString()); await MessageBus.INSTANCE.SendWarning(new (Icons.Material.Filled.Warning, $"The latest pandoc version was not found, installing version {FALLBACK_VERSION.ToString()} instead.")); return FALLBACK_VERSION.ToString(); }