Compare commits

...

3 Commits

Author SHA1 Message Date
7cdf77cbb9 Less logging clutter 2023-06-03 22:55:53 +02:00
5a9aed4969 Kavita naming convention 2023-06-03 22:39:27 +02:00
5b41f687d0 Kavita naming convention 2023-06-03 22:34:02 +02:00

View File

@ -114,17 +114,12 @@ public abstract class Connector
{
Regex legalCharacters = new Regex(@"([A-z]*[0-9]* *\.*-*,*\]*\[*'*\'*\)*\(*~*!*)*");
string oldFilePath = Path.Join(downloadLocation, publication.folderName, $"{string.Concat(legalCharacters.Matches(chapter.name ?? ""))} - V{chapter.volumeNumber}C{chapter.chapterNumber} - {chapter.sortNumber}.cbz");
string oldFilePath2 = Path.Join(downloadLocation, publication.folderName, $"{string.Concat(legalCharacters.Matches(chapter.name ?? ""))} - VC{chapter.chapterNumber} - {chapter.sortNumber}.cbz");
string oldFilePath2 = Path.Join(downloadLocation, publication.folderName, $"{string.Concat(legalCharacters.Matches(chapter.name ?? ""))} - VC{chapter.chapterNumber} - {chapter.chapterNumber}.cbz");
string newFilePath = GetArchiveFilePath(publication, chapter);
if (File.Exists(oldFilePath))
{
logger?.WriteLine(this.GetType().ToString(), $"Moving old file {oldFilePath} -> {newFilePath}");
File.Move(oldFilePath, newFilePath);
}else if (File.Exists(oldFilePath2))
{
logger?.WriteLine(this.GetType().ToString(), $"Moving old file {oldFilePath2} -> {newFilePath}");
else if (File.Exists(oldFilePath2))
File.Move(oldFilePath2, newFilePath);
}
return File.Exists(newFilePath);
}