From bd189caf8019d06db1a0b82abc7e272e0c890a11 Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner Date: Sat, 6 Jul 2024 13:16:10 +0200 Subject: [PATCH] Removed unused constructor. Added default value for empty commit hash --- Moonlight/Core/Services/MoonlightService.cs | 8 ++------ Moonlight/Core/UI/Views/Admin/Sys/Index.razor | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Moonlight/Core/Services/MoonlightService.cs b/Moonlight/Core/Services/MoonlightService.cs index 6aae4a4a..7b7d4d5f 100644 --- a/Moonlight/Core/Services/MoonlightService.cs +++ b/Moonlight/Core/Services/MoonlightService.cs @@ -18,17 +18,13 @@ public class MoonlightService private readonly DateTime StartTimestamp = DateTime.UtcNow; private readonly CoreEvents CoreEvents; private readonly ILogger Logger; - + public MoonlightService(CoreEvents coreEvents, ILogger logger) { CoreEvents = coreEvents; Logger = logger; - } - - public MoonlightService() - { + //TODO: Maybe extract to a method to make this a bit cleaner - if (File.Exists("version")) { var line = File.ReadAllText("version"); diff --git a/Moonlight/Core/UI/Views/Admin/Sys/Index.razor b/Moonlight/Core/UI/Views/Admin/Sys/Index.razor index ce228a35..57f68eda 100644 --- a/Moonlight/Core/UI/Views/Admin/Sys/Index.razor +++ b/Moonlight/Core/UI/Views/Admin/Sys/Index.razor @@ -50,7 +50,7 @@
@{ var commitHashShorted = string.IsNullOrEmpty(MoonlightService.BuildCommitHash) || MoonlightService.BuildCommitHash.Length < 7 - ? "" + ? "N/A" : MoonlightService.BuildCommitHash.Substring(0, 7); // TODO: Add update check (possible during startup, with error handling etc)