From 835e239be5424423ba6c7177a1d288be4617f085 Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 31 Jul 2023 02:07:39 +0200 Subject: [PATCH] Cleanup --- Tranga/Migrator.cs | 6 +++--- Tranga/TaskManager.cs | 4 +--- Tranga/TrangaSettings.cs | 4 +--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Tranga/Migrator.cs b/Tranga/Migrator.cs index 5b519ea..7cf86f3 100644 --- a/Tranga/Migrator.cs +++ b/Tranga/Migrator.cs @@ -16,8 +16,8 @@ public static class Migrator return; JsonNode settingsNode = JsonNode.Parse(File.ReadAllText(settingsFilePath))!; ushort version = settingsNode["version"] is not null - ? settingsNode["version"].GetValue() - : settingsNode["ts"]["version"].GetValue(); + ? settingsNode["version"]!.GetValue() + : settingsNode["ts"]!["version"]!.GetValue(); logger?.WriteLine("Migrator", $"Migrating {version} -> {CurrentVersion}"); switch (version) { @@ -91,7 +91,7 @@ public static class Migrator if (lunaSeaNode is not null) nms.Add(new LunaSea(lunaSeaNode["id"]!.GetValue())); - CommonObjects co = new (lms, nms, null, settingsFilePath); + CommonObjects co = new (lms, nms, logger, settingsFilePath); TrangaSettings.SettingsJsonObject sjo = new(ts, co); File.WriteAllText(settingsFilePath, JsonConvert.SerializeObject(sjo)); diff --git a/Tranga/TaskManager.cs b/Tranga/TaskManager.cs index 04f4afa..518c5ad 100644 --- a/Tranga/TaskManager.cs +++ b/Tranga/TaskManager.cs @@ -21,7 +21,7 @@ public class TaskManager public TaskManager(TrangaSettings settings, Logging.Logger? logger) { commonObjects = CommonObjects.LoadSettings(settings.settingsFilePath, logger); - commonObjects.logger?.WriteLine("Tranga", value: "\n"+ + commonObjects.logger?.WriteLine(this.GetType().ToString(), value: "\n"+ @"-----------------------------------------------------------------"+"\n"+ @" |¯¯¯¯¯¯|°|¯¯¯¯¯¯\ /¯¯¯¯¯¯| |¯¯¯\|¯¯¯| /¯¯¯¯¯¯\' /¯¯¯¯¯¯| "+"\n"+ @" | | | x <|' / ! | | '| | (/¯¯¯\° / ! | "+ "\n"+ @@ -205,8 +205,6 @@ public class TaskManager { switch (taskType) { - case TrangaTask.Task.UpdateLibraries: - return _allTasks.Where(tTask => tTask.task == TrangaTask.Task.UpdateLibraries); case TrangaTask.Task.MonitorPublication: if(connectorName is null) return _allTasks.Where(tTask => tTask.task == taskType); diff --git a/Tranga/TrangaSettings.cs b/Tranga/TrangaSettings.cs index 6173ac2..a37de07 100644 --- a/Tranga/TrangaSettings.cs +++ b/Tranga/TrangaSettings.cs @@ -1,6 +1,4 @@ -using System.Text.Json.Nodes; -using Logging; -using Newtonsoft.Json; +using Newtonsoft.Json; using Tranga.LibraryManagers; using Tranga.NotificationManagers;