From cbdc91985b983e592079a0b2242ffdf43a8c0a62 Mon Sep 17 00:00:00 2001 From: glax <--local> Date: Thu, 18 May 2023 18:20:04 +0200 Subject: [PATCH] fixed bug where offset was increased too soon --- Tranga/Connectors/MangaDex.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tranga/Connectors/MangaDex.cs b/Tranga/Connectors/MangaDex.cs index 35180b7..109a481 100644 --- a/Tranga/Connectors/MangaDex.cs +++ b/Tranga/Connectors/MangaDex.cs @@ -28,6 +28,7 @@ public class MangaDex : Connector offset += limit; DownloadClient.RequestResult requestResult = _downloadClient.MakeRequest(string.Concat(publicationsUrl, "0")); JsonObject? result = JsonSerializer.Deserialize(requestResult.result); + offset += limit; if (result is null) break; @@ -122,10 +123,11 @@ public class MangaDex : Connector List chapters = new(); while (offset < total) { - offset += limit; DownloadClient.RequestResult requestResult = _downloadClient.MakeRequest($"https://api.mangadex.org/manga/{id}/feed?limit={limit}&offset={offset}&translatedLanguage%5B%5D={language}"); JsonObject? result = JsonSerializer.Deserialize(requestResult.result); + + offset += limit; if (result is null) break;