From 9ccba6fba683bb40e438e493714f63c3b725dc28 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 25 Jun 2023 23:56:22 +0200 Subject: [PATCH] Fix CheckChapterIsDownloaded Directory does not exists exception returning 0 chapters --- Tranga/Connector.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tranga/Connector.cs b/Tranga/Connector.cs index 3fad1f4..1082a04 100644 --- a/Tranga/Connector.cs +++ b/Tranga/Connector.cs @@ -187,7 +187,9 @@ public abstract class Connector public bool CheckChapterIsDownloaded(Publication publication, Chapter chapter) { string newFilePath = GetArchiveFilePath(publication, chapter); - FileInfo[] archives = new DirectoryInfo(Path.Join(downloadLocation, publication.folderName)).GetFiles("*.cbz"); + if (!Directory.Exists(Path.Join(downloadLocation, publication.folderName))) + return false; + FileInfo[] archives = new DirectoryInfo(Path.Join(downloadLocation, publication.folderName)).GetFiles(); Regex chapterRex = new(@"(Vol.[0-9]*)*Ch.[0-9]+"); if (File.Exists(newFilePath))