From b9d89edfc24afef47ef14fbadaa9623d5a9f2472 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Tue, 23 Jul 2024 10:04:46 +0300 Subject: [PATCH] [DynastyScans] Fixes --- .../org/koitharu/kotatsu/parsers/site/en/DynastyScans.kt | 8 +++++--- .../kotlin/org/koitharu/kotatsu/parsers/MangaSources.kt | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/DynastyScans.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/DynastyScans.kt index 90d17742..e5786013 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/DynastyScans.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/DynastyScans.kt @@ -39,8 +39,7 @@ internal class DynastyScans(context: MangaLoaderContext) : append("/search?q=") append(filter.query.urlEncoded()) append("&") - append("classes[]".urlEncoded()) - append("=Serie&page=") + append("classes[]=Series&page=") append(page.toString()) } return parseMangaListQuery(webClient.httpGet(url).parseHtml()) @@ -155,6 +154,9 @@ internal class DynastyScans(context: MangaLoaderContext) : val doc = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml() val chapters = getChapters(doc) val root = doc.requireElementById("main") + val licensedText = root.select("h4") + .find { it.ownText() == "This manga has been licensed" } + ?.nextElementSibling()?.html() return manga.copy( altTitle = null, state = when (root.select("h2.tag-title small").last()?.text()) { @@ -168,7 +170,7 @@ internal class DynastyScans(context: MangaLoaderContext) : .orEmpty(), // It is needed if the manga was found via the search. tags = root.selectFirstOrThrow("div.tag-tags").parseTags(), author = null, - description = null, + description = licensedText, chapters = chapters, ) } diff --git a/src/test/kotlin/org/koitharu/kotatsu/parsers/MangaSources.kt b/src/test/kotlin/org/koitharu/kotatsu/parsers/MangaSources.kt index 4673f6fa..3b5081f5 100644 --- a/src/test/kotlin/org/koitharu/kotatsu/parsers/MangaSources.kt +++ b/src/test/kotlin/org/koitharu/kotatsu/parsers/MangaSources.kt @@ -1,7 +1,8 @@ package org.koitharu.kotatsu.parsers import org.junit.jupiter.params.provider.EnumSource +import org.junit.jupiter.params.provider.EnumSource.Mode.EXCLUDE import org.koitharu.kotatsu.parsers.model.MangaParserSource -@EnumSource(MangaParserSource::class) +@EnumSource(MangaParserSource::class, names = ["DUMMY"], mode = EXCLUDE) internal annotation class MangaSources