diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/vi/HentaiCube.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/vi/HentaiCube.kt index bc6fa5c0..bbeada20 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/vi/HentaiCube.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madara/vi/HentaiCube.kt @@ -43,6 +43,7 @@ internal class HentaiCube(context: MangaLoaderContext) : val url = buildString { if (!filter.author.isNullOrEmpty()) { + clear() append("https://") append(domain) append("/tacgia/") diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/vi/KuroNeko.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/vi/KuroNeko.kt index 9894a635..01549dd0 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/vi/KuroNeko.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/vi/KuroNeko.kt @@ -32,6 +32,7 @@ internal class KuroNeko(context: MangaLoaderContext) : LegacyPagedMangaParser(co isMultipleTagsSupported = true, isTagsExclusionSupported = true, isSearchWithFiltersSupported = true, + isAuthorSearchSupported = true, ) override suspend fun getFilterOptions() = MangaListFilterOptions( @@ -41,6 +42,43 @@ internal class KuroNeko(context: MangaLoaderContext) : LegacyPagedMangaParser(co override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List { val url = buildString { + if (!filter.author.isNullOrEmpty()) { + clear() + append("https://") + append(domain) + + append("/tac-gia/") + append(filter.author.lowercase().replace(" ", "-")) + + append("?sort=") + append( + when (order) { + SortOrder.POPULARITY -> "-views" + SortOrder.UPDATED -> "-updated_at" + SortOrder.NEWEST -> "-created_at" + SortOrder.ALPHABETICAL -> "name" + SortOrder.ALPHABETICAL_DESC -> "-name" + else -> "-updated_at" + }, + ) + + append("&page=") + append(page) + + append("&filter[status]=") + filter.states.forEach { + append( + when (it) { + MangaState.ONGOING -> "2," + MangaState.FINISHED -> "1," + else -> "2,1" + }, + ) + } + + return@buildString // end of buildString + } + append("https://") append(domain)