mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 15:50:13 +01:00
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:
parent
17ef5eae0f
commit
94582496ef
@ -216,6 +216,7 @@ public class MangaDex : MangaConnector
|
|||||||
{
|
{
|
||||||
JsonObject chapter = (JsonObject)jsonNode!;
|
JsonObject chapter = (JsonObject)jsonNode!;
|
||||||
JsonObject attributes = chapter["attributes"]!.AsObject();
|
JsonObject attributes = chapter["attributes"]!.AsObject();
|
||||||
|
|
||||||
string chapterId = chapter["id"]!.GetValue<string>();
|
string chapterId = chapter["id"]!.GetValue<string>();
|
||||||
|
|
||||||
string? title = attributes.ContainsKey("title") && attributes["title"] is not null
|
string? title = attributes.ContainsKey("title") && attributes["title"] is not null
|
||||||
@ -230,6 +231,14 @@ public class MangaDex : MangaConnector
|
|||||||
? attributes["chapter"]!.GetValue<string>()
|
? attributes["chapter"]!.GetValue<string>()
|
||||||
: "null";
|
: "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")
|
if(chapterNum is not "null")
|
||||||
chapters.Add(new Chapter(manga, title, volume, chapterNum, chapterId));
|
chapters.Add(new Chapter(manga, title, volume, chapterNum, chapterId));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user