diff --git a/Tranga/MangaConnectors/MangaDex.cs b/Tranga/MangaConnectors/MangaDex.cs index aef00df..84b8891 100644 --- a/Tranga/MangaConnectors/MangaDex.cs +++ b/Tranga/MangaConnectors/MangaDex.cs @@ -216,6 +216,7 @@ public class MangaDex : MangaConnector { JsonObject chapter = (JsonObject)jsonNode!; JsonObject attributes = chapter["attributes"]!.AsObject(); + string chapterId = chapter["id"]!.GetValue(); string? title = attributes.ContainsKey("title") && attributes["title"] is not null @@ -230,6 +231,14 @@ public class MangaDex : MangaConnector ? attributes["chapter"]!.GetValue() : "null"; + + if (attributes.ContainsKey("pages") && attributes["pages"] is not null && + attributes["pages"]!.GetValue() < 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)); }