DoujinDesu.tv: Fix search query, add author search support (#2326)

master
Draken 6 months ago committed by GitHub
parent 65c61c0c01
commit a39721eaf7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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<Manga> {
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(' ', '+')
}

Loading…
Cancel
Save