Jable: Correct the language code and fix the issue of only one page loaded. (#481)
This commit is contained in:
parent
9b0e6b264c
commit
6853962f8c
4 changed files with 12 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Jable'
|
extName = 'Jable'
|
||||||
extClass = '.JableFactory'
|
extClass = '.JableFactory'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Jable(override val lang: String) : AnimeHttpSource() {
|
||||||
private var tagsUpdated = false
|
private var tagsUpdated = false
|
||||||
|
|
||||||
override fun animeDetailsRequest(anime: SAnime): Request {
|
override fun animeDetailsRequest(anime: SAnime): Request {
|
||||||
return GET("$baseUrl${anime.url}?lang=$lang", headers)
|
return GET("$baseUrl${anime.url}?lang=${lang.toRequestLang()}", headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun animeDetailsParse(response: Response): SAnime {
|
override fun animeDetailsParse(response: Response): SAnime {
|
||||||
|
@ -88,7 +88,7 @@ class Jable(override val lang: String) : AnimeHttpSource() {
|
||||||
title = it.select(".detail .title").text()
|
title = it.select(".detail .title").text()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doc.select(".container .pagination .page-item .page-link.disabled").isNullOrEmpty(),
|
true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ class Jable(override val lang: String) : AnimeHttpSource() {
|
||||||
): Request {
|
): Request {
|
||||||
val urlBuilder = baseUrl.toHttpUrl().newBuilder()
|
val urlBuilder = baseUrl.toHttpUrl().newBuilder()
|
||||||
.addPathSegments("$path/")
|
.addPathSegments("$path/")
|
||||||
.addQueryParameter("lang", lang)
|
.addQueryParameter("lang", lang.toRequestLang())
|
||||||
if (tagsUpdated) {
|
if (tagsUpdated) {
|
||||||
// load whole page for update filter tags info
|
// load whole page for update filter tags info
|
||||||
urlBuilder.addQueryParameter("mode", "async")
|
urlBuilder.addQueryParameter("mode", "async")
|
||||||
|
@ -204,6 +204,11 @@ class Jable(override val lang: String) : AnimeHttpSource() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun String.toRequestLang(): String {
|
||||||
|
if (this == "ja") return "jp"
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
private val intl by lazy {
|
private val intl by lazy {
|
||||||
JableIntl(lang)
|
JableIntl(lang)
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ class JableFactory : AnimeSourceFactory {
|
||||||
return listOf(
|
return listOf(
|
||||||
Jable("zh"),
|
Jable("zh"),
|
||||||
Jable("en"),
|
Jable("en"),
|
||||||
Jable("jp"),
|
Jable("ja"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ internal class JableIntl private constructor(delegate: Intl) : Intl by delegate
|
||||||
constructor(lang: String) : this(
|
constructor(lang: String) : this(
|
||||||
when (lang) {
|
when (lang) {
|
||||||
"zh" -> ZH()
|
"zh" -> ZH()
|
||||||
"jp" -> JP()
|
"ja" -> JA()
|
||||||
"en" -> EN()
|
"en" -> EN()
|
||||||
else -> ZH()
|
else -> ZH()
|
||||||
},
|
},
|
||||||
|
@ -43,7 +43,7 @@ internal class ZH : Intl {
|
||||||
override val filterTagTitle: String = "標籤"
|
override val filterTagTitle: String = "標籤"
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class JP : Intl {
|
internal class JA : Intl {
|
||||||
override val popular: String = "人気優先"
|
override val popular: String = "人気優先"
|
||||||
override val latestUpdate: String = "新作優先"
|
override val latestUpdate: String = "新作優先"
|
||||||
override val sortLatestUpdate: String = "最近更新"
|
override val sortLatestUpdate: String = "最近更新"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue