Koushoku: tweak search, fix details parsing (#12712)
* Koushoku: tweak search, fix details parsing Search/filters are now using the AND operator, which is a more sane default than the previous OR operator. Additionally the queries are properly encased in double quotes. Uninitialized manga titles are now properly parsed if they are in a collection, previously it would concatenate all titles together. * * is required for partial search queries * partial search for filters as well
This commit is contained in:
parent
996513d0e3
commit
972c1e2f37
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'Koushoku'
|
extName = 'Koushoku'
|
||||||
pkgNameSuffix = 'en.koushoku'
|
pkgNameSuffix = 'en.koushoku'
|
||||||
extClass = '.Koushoku'
|
extClass = '.Koushoku'
|
||||||
extVersionCode = 7
|
extVersionCode = 8
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ class Koushoku : ParsedHttpSource() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun buildAdvQuery(query: String, filterList: FilterList): String {
|
private fun buildAdvQuery(query: String, filterList: FilterList): String {
|
||||||
val title = if (query.isNotBlank()) "title*:$query " else ""
|
val title = if (query.isNotBlank()) "title*:\"$query\" " else ""
|
||||||
val filters: List<String> = filterList.filterIsInstance<Filter.Text>().map { filter ->
|
val filters: List<String> = filterList.filterIsInstance<Filter.Text>().map { filter ->
|
||||||
if (filter.state.isBlank()) return@map ""
|
if (filter.state.isBlank()) return@map ""
|
||||||
val included = mutableListOf<String>()
|
val included = mutableListOf<String>()
|
||||||
@ -98,8 +98,8 @@ class Koushoku : ParsedHttpSource() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildString {
|
buildString {
|
||||||
if (included.isNotEmpty()) append("$name*:${included.joinToString(",")} ")
|
if (included.isNotEmpty()) append("$name&*:\"${included.joinToString(",")}\" ")
|
||||||
if (excluded.isNotEmpty()) append("-$name*:${excluded.joinToString(",")}")
|
if (excluded.isNotEmpty()) append("-$name&*:\"${excluded.joinToString(",")}\"")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "$title${
|
return "$title${
|
||||||
@ -117,8 +117,8 @@ class Koushoku : ParsedHttpSource() {
|
|||||||
override fun popularMangaFromElement(element: Element) = latestUpdatesFromElement(element)
|
override fun popularMangaFromElement(element: Element) = latestUpdatesFromElement(element)
|
||||||
|
|
||||||
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
|
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
|
||||||
title = document.select(".metadata .title").text()
|
title = document.selectFirst(".metadata .title").text()
|
||||||
thumbnail_url = document.select(thumbnailSelector).attr("src")
|
thumbnail_url = document.selectFirst(thumbnailSelector).attr("src")
|
||||||
artist = document.select(".metadata .artists a, .metadata .circles a")
|
artist = document.select(".metadata .artists a, .metadata .circles a")
|
||||||
.joinToString { it.text() }
|
.joinToString { it.text() }
|
||||||
author = artist
|
author = artist
|
||||||
|
Loading…
x
Reference in New Issue
Block a user