diff --git a/Tranga/Tranga.cs b/Tranga/Tranga.cs index 16f01c3..02ccded 100644 --- a/Tranga/Tranga.cs +++ b/Tranga/Tranga.cs @@ -13,6 +13,8 @@ public partial class Tranga : GlobalBase public Tranga(Logger? logger, TrangaSettings settings) : base(logger, settings) { + Log("\n\n _______ \n|_ _|.----..---.-..-----..-----..---.-.\n | | | _|| _ || || _ || _ |\n |___| |__| |___._||__|__||___ ||___._|\n |_____| \n\n"); + Log(settings.ToString()); keepRunning = true; _connectors = new HashSet() { diff --git a/Tranga/TrangaSettings.cs b/Tranga/TrangaSettings.cs index cb62cf6..e3aae4c 100644 --- a/Tranga/TrangaSettings.cs +++ b/Tranga/TrangaSettings.cs @@ -23,13 +23,13 @@ public class TrangaSettings string lockFilePath = $"{settingsFilePath}.lock"; if (File.Exists(settingsFilePath) && !File.Exists(lockFilePath)) {//Load from settings file - FileStream lockFile = File.Create(lockFilePath,0, FileOptions.DeleteOnClose); + FileStream lockFile = File.Create(lockFilePath,0, FileOptions.DeleteOnClose); //lock settingsfile string settingsStr = File.ReadAllText(settingsFilePath); TrangaSettings settings = JsonConvert.DeserializeObject(settingsStr)!; this.downloadLocation = downloadLocation ?? settings.downloadLocation; this.workingDirectory = workingDirectory ?? settings.workingDirectory; this.apiPortNumber = apiPortNumber ?? settings.apiPortNumber; - lockFile.Close(); + lockFile.Close(); //unlock settingsfile } else if(!File.Exists(settingsFilePath)) {//No settings file exists @@ -132,4 +132,15 @@ public class TrangaSettings { return Path.Join(this.coverImageCache, manga.coverFileNameInCache); } + + public override string ToString() + { + return $"TrangaSettings:\n" + + $"\tDownloadLocation: {downloadLocation}\n" + + $"\tworkingDirectory: {workingDirectory}\n" + + $"\tjobsFolderPath: {jobsFolderPath}\n" + + $"\tsettingsFilePath: {settingsFilePath}\n" + + $"\t\tnotificationConnectors: {notificationConnectorsFilePath}\n" + + $"\t\tlibraryConnectors: {libraryConnectorsFilePath}\n"; + } } \ No newline at end of file