2
0

Mangadex do not try downloading externally linked chapters, or chapters that have no pages.

https://github.com/C9Glax/tranga/issues/153
This commit is contained in:
Glax 2024-04-01 20:00:02 +02:00
parent 17ef5eae0f
commit 94582496ef

View File

@ -216,6 +216,7 @@ public class MangaDex : MangaConnector
{
JsonObject chapter = (JsonObject)jsonNode!;
JsonObject attributes = chapter["attributes"]!.AsObject();
string chapterId = chapter["id"]!.GetValue<string>();
string? title = attributes.ContainsKey("title") && attributes["title"] is not null
@ -230,6 +231,14 @@ public class MangaDex : MangaConnector
? attributes["chapter"]!.GetValue<string>()
: "null";
if (attributes.ContainsKey("pages") && attributes["pages"] is not null &&
attributes["pages"]!.GetValue<int>() < 1)
{
Log($"Skipping {chapterId} Vol.{volume} Ch.{chapterNum} {title} because it has no pages or is externally linked.");
continue;
}
if(chapterNum is not "null")
chapters.Add(new Chapter(manga, title, volume, chapterNum, chapterId));
}