mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
parent
669fa35cab
commit
440487fc8b
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Brasil Hentai'
|
||||
extClass = '.BrasilHentai'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -122,10 +122,16 @@ class BrasilHentai : ParsedHttpSource() {
|
||||
}
|
||||
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||
return if (query.startsWith(PREFIX_SEARCH)) {
|
||||
client.newCall(GET("$baseUrl/${query.substringAfter(PREFIX_SEARCH)}", headers))
|
||||
return if (query.startsWith(SEARCH_PREFIX)) {
|
||||
val url = "$baseUrl/${query.substringAfter(SEARCH_PREFIX)}/"
|
||||
client.newCall(GET(url, headers))
|
||||
.asObservableSuccess()
|
||||
.map { MangasPage(listOf(searchMangaFromElement(it.asJsoup())), false) }
|
||||
.map {
|
||||
val manga = mangaDetailsParse(it).apply {
|
||||
setUrlWithoutDomain(url)
|
||||
}
|
||||
MangasPage(listOf(manga), false)
|
||||
}
|
||||
} else {
|
||||
super.fetchSearchManga(page, query, filters)
|
||||
}
|
||||
@ -168,6 +174,6 @@ class BrasilHentai : ParsedHttpSource() {
|
||||
private fun categoriesRequest(): Request = GET(baseUrl, headers)
|
||||
|
||||
companion object {
|
||||
val PREFIX_SEARCH: String = "slug:"
|
||||
const val SEARCH_PREFIX: String = "slug:"
|
||||
}
|
||||
}
|
||||
|
@ -11,11 +11,12 @@ class BrasilHentaiUrlActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val segment = intent?.data?.lastPathSegment
|
||||
if (segment != null) {
|
||||
val pathSegments = intent?.data?.pathSegments
|
||||
if (pathSegments != null && pathSegments.size >= 1) {
|
||||
val item = pathSegments[pathSegments.size - 1]
|
||||
val mainIntent = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.SEARCH"
|
||||
putExtra("query", "${BrasilHentai.PREFIX_SEARCH}$segment")
|
||||
putExtra("query", "${BrasilHentai.SEARCH_PREFIX}$item")
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user