From a39721eaf7ddd60058ac44b28bda0be9fd036e36 Mon Sep 17 00:00:00 2001 From: Draken <131387159+dragonx943@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:40:54 +0700 Subject: [PATCH] DoujinDesu.tv: Fix search query, add author search support (#2326) --- .../parsers/site/id/DoujinDesuParser.kt | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/DoujinDesuParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/DoujinDesuParser.kt index d6abf754..d1c27ed7 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/DoujinDesuParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/id/DoujinDesuParser.kt @@ -30,6 +30,7 @@ internal class DoujinDesuParser(context: MangaLoaderContext) : isMultipleTagsSupported = true, isSearchSupported = true, isSearchWithFiltersSupported = true, + isAuthorSearchSupported = true, ) override suspend fun getFilterOptions() = MangaListFilterOptions( @@ -49,17 +50,25 @@ internal class DoujinDesuParser(context: MangaLoaderContext) : override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List { val url = urlBuilder().apply { - addPathSegment("manga") - addPathSegment("page") - addPathSegment("$page/") + when { + page > 1 -> addPathSegments("manga/page/$page/") + else -> addPathSegment("manga/") + } - addQueryParameter( + addQueryParameter( "title", filter.query?.let { filter.query }, ) + addQueryParameter( + name = "author", + value = filter.author?.let { it + space2plus(it).lowercase() + } + ) + addQueryParameter( "order", when (order) { @@ -97,14 +106,6 @@ internal class DoujinDesuParser(context: MangaLoaderContext) : }, ) } - - // Author - // addQueryParameter("author", - // filter.author?.let { - // filter.author - // } - // ) - }.build() return webClient.httpGet(url).parseHtml() @@ -204,4 +205,6 @@ internal class DoujinDesuParser(context: MangaLoaderContext) : ) } } + + private fun space2plus(input: String): String = input.replace(' ', '+') }