Fixed Publication.InternalId

This commit is contained in:
glax 2023-05-22 18:28:42 +02:00
parent 01cb74c088
commit 93cf341f2d
2 changed files with 4 additions and 2 deletions

View File

@ -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}"));
}
/// <returns>Serialized JSON String for series.json</returns>

View File

@ -169,6 +169,8 @@ public class TaskManager
_chapterCollection.TryAdd((Publication)publication!, new List<Chapter>());
_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();