2
0

Catch parsing error #93 to prevent crashes and restart loops

This commit is contained in:
Glax 2023-12-24 16:27:20 +01:00
parent 23e5c4a7b1
commit 29f6de2590

View File

@ -64,9 +64,19 @@ public abstract class MangaConnector : GlobalBase
&& chapterNumber > manga.ignoreChaptersBelow
&& !nChapter.CheckChapterIsDownloaded(settings.downloadLocation)).ToList();
Log($"{newChaptersList.Count} new chapters. {manga}");
try
{
Chapter latestChapterAvailable =
allChapters.MaxBy(chapter => Convert.ToSingle(chapter.chapterNumber, numberFormatDecimalPoint));
manga.latestChapterAvailable = Convert.ToSingle(latestChapterAvailable.chapterNumber, numberFormatDecimalPoint);
manga.latestChapterAvailable =
Convert.ToSingle(latestChapterAvailable.chapterNumber, numberFormatDecimalPoint);
}
catch (FormatException f)
{
Log(f.ToString());
Log($"Failed getting new Chapters for {manga}");
return Array.Empty<Chapter>();
}
return newChaptersList.ToArray();
}