From ed2f69423f3f06d6d64724dcfbfd0220b8542c38 Mon Sep 17 00:00:00 2001 From: milesoc Date: Tue, 18 Jun 2024 16:41:24 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20milesoc/?= =?UTF-8?q?community-extensions@50b3dcac8e5b33617fcd2a4bbe11ef413bbbc47a?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0.8/MangaDex/index.js | 11 ++++++++++- 0.8/MangaDex/source.js | 11 ++++++++++- 0.8/versioning.json | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/0.8/MangaDex/index.js b/0.8/MangaDex/index.js index 187489a..47a0908 100644 --- a/0.8/MangaDex/index.js +++ b/0.8/MangaDex/index.js @@ -3558,7 +3558,7 @@ class MangaDex { metadata: { offset: offset + 100, collectedIds } }); } - async appendCoverArt(sourceMangaAsync, thumbnailSelector) { + async appendCoverArt(sourceMangaAsync, thumbnailSelector, offset = 0) { return sourceMangaAsync.then((sourceManga) => { const request = App.createRequest({ url: new MangaDexHelper_1.URLBuilder(this.MANGADEX_API) @@ -3566,6 +3566,7 @@ class MangaDex { .addQueryParameter('manga', sourceManga.map((manga) => manga.mangaId)) .addQueryParameter('includes', ['manga']) .addQueryParameter('limit', 100) + .addQueryParameter('offset', offset) .addQueryParameter('order', { volume: 'asc' }) .buildUrl(), method: 'GET' @@ -3576,6 +3577,14 @@ class MangaDex { return sourceManga; } const json = (typeof response.data === 'string') ? JSON.parse(response.data) : response.data; + const total = Number(json.total); + const limit = Number(json.limit); + const offset = Number(json.offset); + if (total > limit + offset) { + return (0, MangaDexParser_1.addFileNamesToManga)(sourceManga, json.data, this, thumbnailSelector).then((manga) => { + return this.appendCoverArt(Promise.resolve(manga), thumbnailSelector, offset + limit); + }); + } return (0, MangaDexParser_1.addFileNamesToManga)(sourceManga, json.data, this, thumbnailSelector); }); }); diff --git a/0.8/MangaDex/source.js b/0.8/MangaDex/source.js index 187489a..47a0908 100644 --- a/0.8/MangaDex/source.js +++ b/0.8/MangaDex/source.js @@ -3558,7 +3558,7 @@ class MangaDex { metadata: { offset: offset + 100, collectedIds } }); } - async appendCoverArt(sourceMangaAsync, thumbnailSelector) { + async appendCoverArt(sourceMangaAsync, thumbnailSelector, offset = 0) { return sourceMangaAsync.then((sourceManga) => { const request = App.createRequest({ url: new MangaDexHelper_1.URLBuilder(this.MANGADEX_API) @@ -3566,6 +3566,7 @@ class MangaDex { .addQueryParameter('manga', sourceManga.map((manga) => manga.mangaId)) .addQueryParameter('includes', ['manga']) .addQueryParameter('limit', 100) + .addQueryParameter('offset', offset) .addQueryParameter('order', { volume: 'asc' }) .buildUrl(), method: 'GET' @@ -3576,6 +3577,14 @@ class MangaDex { return sourceManga; } const json = (typeof response.data === 'string') ? JSON.parse(response.data) : response.data; + const total = Number(json.total); + const limit = Number(json.limit); + const offset = Number(json.offset); + if (total > limit + offset) { + return (0, MangaDexParser_1.addFileNamesToManga)(sourceManga, json.data, this, thumbnailSelector).then((manga) => { + return this.appendCoverArt(Promise.resolve(manga), thumbnailSelector, offset + limit); + }); + } return (0, MangaDexParser_1.addFileNamesToManga)(sourceManga, json.data, this, thumbnailSelector); }); }); diff --git a/0.8/versioning.json b/0.8/versioning.json index 9380323..fb5e014 100644 --- a/0.8/versioning.json +++ b/0.8/versioning.json @@ -1 +1 @@ -{"buildTime":"2024-06-18T16:01:49.521Z","sources":[{"id":"BatoTo","name":"BatoTo","author":"niclimcy","desc":"Extension that pulls manga from bato.to","website":"https://github.com/niclimcy","contentRating":"MATURE","version":"3.1.2","icon":"icon.png","tags":[{"text":"Multi Language","type":"default"}],"websiteBaseURL":"https://bato.to","intents":53},{"id":"Hentai2Read","name":"Hentai2Read","author":"EmZedH","desc":"Extension that pulls manga from hentai2read.com","website":"https://github.com/EmZedH","contentRating":"ADULT","version":"1.0.1","icon":"icon.png","tags":[{"text":"18+","type":"warning"}],"websiteBaseURL":"https://hentai2read.com","intents":5},{"id":"MangaDex","name":"MangaDex","author":"Nar1n & Netsky","desc":"Extension that pulls manga from MangaDex","website":"https://github.com/nar1n","contentRating":"EVERYONE","version":"3.0.5","icon":"icon.png","tags":[],"websiteBaseURL":"https://mangadex.org","intents":37},{"id":"MangaPlus","name":"MangaPlus","author":"Rinto-kun","desc":"Extension that pulls manga from Manga+ by Shueisha","website":"https://github.com/Rinto-kun","contentRating":"EVERYONE","version":"2.0.2","icon":"icon.png","tags":[],"websiteBaseURL":"https://mangaplus.shueisha.co.jp","intents":53},{"id":"NHentai","name":"nhentai","author":"NotMarek & Netsky","desc":"Extension which pulls content from nHentai.","website":"https://github.com/TheNetsky","contentRating":"ADULT","version":"4.0.7","icon":"icon.png","tags":[{"text":"18+","type":"warning"}],"websiteBaseURL":"https://nhentai.net","intents":53}],"builtWith":{"toolchain":"0.8.0-alpha.47","types":"0.8.0-alpha.47"}} \ No newline at end of file +{"buildTime":"2024-06-18T16:41:22.591Z","sources":[{"id":"BatoTo","name":"BatoTo","author":"niclimcy","desc":"Extension that pulls manga from bato.to","website":"https://github.com/niclimcy","contentRating":"MATURE","version":"3.1.2","icon":"icon.png","tags":[{"text":"Multi Language","type":"default"}],"websiteBaseURL":"https://bato.to","intents":53},{"id":"Hentai2Read","name":"Hentai2Read","author":"EmZedH","desc":"Extension that pulls manga from hentai2read.com","website":"https://github.com/EmZedH","contentRating":"ADULT","version":"1.0.1","icon":"icon.png","tags":[{"text":"18+","type":"warning"}],"websiteBaseURL":"https://hentai2read.com","intents":5},{"id":"MangaDex","name":"MangaDex","author":"Nar1n & Netsky","desc":"Extension that pulls manga from MangaDex","website":"https://github.com/nar1n","contentRating":"EVERYONE","version":"3.0.5","icon":"icon.png","tags":[],"websiteBaseURL":"https://mangadex.org","intents":37},{"id":"MangaPlus","name":"MangaPlus","author":"Rinto-kun","desc":"Extension that pulls manga from Manga+ by Shueisha","website":"https://github.com/Rinto-kun","contentRating":"EVERYONE","version":"2.0.2","icon":"icon.png","tags":[],"websiteBaseURL":"https://mangaplus.shueisha.co.jp","intents":53},{"id":"NHentai","name":"nhentai","author":"NotMarek & Netsky","desc":"Extension which pulls content from nHentai.","website":"https://github.com/TheNetsky","contentRating":"ADULT","version":"4.0.7","icon":"icon.png","tags":[{"text":"18+","type":"warning"}],"websiteBaseURL":"https://nhentai.net","intents":53}],"builtWith":{"toolchain":"0.8.0-alpha.47","types":"0.8.0-alpha.47"}} \ No newline at end of file