From 93cf341f2d40d8c896cbbd584b366c9a15f08749 Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 22 May 2023 18:28:42 +0200 Subject: [PATCH] Fixed Publication.InternalId --- Tranga/Publication.cs | 4 ++-- Tranga/TaskManager.cs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Tranga/Publication.cs b/Tranga/Publication.cs index 692f636..793f616 100644 --- a/Tranga/Publication.cs +++ b/Tranga/Publication.cs @@ -37,8 +37,8 @@ public readonly struct Publication this.status = status; this.publicationId = publicationId; this.folderName = string.Concat(sortName.Split(Path.GetInvalidPathChars().Concat(Path.GetInvalidFileNameChars()).ToArray())); - string onlyLowerAscii = this.sortName.ToLower().Where(Char.IsAscii).ToString()!; - this.internalId = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{onlyLowerAscii}{this.year}")); + string onlyLowerLetters = string.Concat(this.sortName.ToLower().Where(Char.IsLetter)); + this.internalId = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{onlyLowerLetters}{this.year}")); } /// Serialized JSON String for series.json diff --git a/Tranga/TaskManager.cs b/Tranga/TaskManager.cs index 56d89ce..de0a63d 100644 --- a/Tranga/TaskManager.cs +++ b/Tranga/TaskManager.cs @@ -169,6 +169,8 @@ public class TaskManager _chapterCollection.TryAdd((Publication)publication!, new List()); _allTasks.Add(newTask); } + else + logger.WriteLine(this.GetType().ToString(), $"Publication already exists {publication?.internalId}"); } logger?.WriteLine(this.GetType().ToString(), $"Added new Task {newTask.ToString()}"); ExportData();