HentaiMimi: fix pages for titles with comma, order filters alphabetically (#6898)
* Fix pages when title contains comma * Sort filters for easier search * Bump version * Remove extra new line at the end of the generated file
This commit is contained in:
parent
deec443983
commit
6be3b361fd
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'HentaiMimi'
|
||||
pkgNameSuffix = 'en.hentaimimi'
|
||||
extClass = '.HentaiMimi'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
libVersion = '1.2'
|
||||
containsNsfw = true
|
||||
}
|
||||
|
|
|
@ -34,13 +34,13 @@ class FilterOptGen {
|
|||
types.forEach {
|
||||
try {
|
||||
val document = getDocument("https://hentaimimi.com/search")
|
||||
val ids = parseIds(document!!, it)
|
||||
val ids = parseIds(document!!, it).sortedBy { id -> id.first }
|
||||
|
||||
buffer.append("fun $it() = listOf(\n")
|
||||
for (id in ids) {
|
||||
when (it) {
|
||||
"tags" -> buffer.append(" HentaiMimi.TriStateFilterOption(\"${id.first}\",\"${id.second}\"),\n")
|
||||
else -> buffer.append(" HentaiMimi.CheckboxFilterOption(\"${id.first}\",\"${id.second}\"),\n")
|
||||
"tags" -> buffer.append(" HentaiMimi.TriStateFilterOption(\"${id.first}\", \"${id.second}\"),\n")
|
||||
else -> buffer.append(" HentaiMimi.CheckboxFilterOption(\"${id.first}\", \"${id.second}\"),\n")
|
||||
}
|
||||
}
|
||||
buffer.append(")\n\n")
|
||||
|
@ -49,6 +49,7 @@ class FilterOptGen {
|
|||
println("error generating source $it ${e.printStackTrace()}")
|
||||
}
|
||||
}
|
||||
buffer.setLength(buffer.length - 1)
|
||||
println("Post-run types: ${number - 1}")
|
||||
val writer = PrintWriter(relativePath)
|
||||
writer.write(buffer.toString())
|
||||
|
|
|
@ -144,7 +144,7 @@ class HentaiMimi : ParsedHttpSource() {
|
|||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val pages = mutableListOf<Page>()
|
||||
document.select("body main script").html().substringAfter("[").substringBefore("]").split(",").forEachIndexed { index, it ->
|
||||
document.select("body main script").html().substringAfter("[").substringBefore("]").split("\",\"").forEachIndexed { index, it ->
|
||||
val url = "$baseUrl/${it.replace("\\", "").replace("\"", "")}"
|
||||
pages.add(Page(index, url, url))
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue