MangaTerra - Fix deep linking (#3142)

* Fix deep linking

* Bump version

* Fix path files
This commit is contained in:
Chopper 2024-05-22 02:25:55 -03:00 committed by Draff
parent f497bddc71
commit cf75a1f995
4 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Manga Terra'
extClass = '.MangaTerra'
extVersionCode = 1
extVersionCode = 2
isNsfw = true
}

View File

@ -104,8 +104,8 @@ class MangaTerra : ParsedHttpSource() {
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
if (query.startsWith(slugPrefix)) {
val slug = query.substringAfter(slugPrefix)
if (query.startsWith(PREFIX_SEARCH)) {
val slug = query.substringAfter(PREFIX_SEARCH)
return client.newCall(GET("$baseUrl/manga/$slug", headers))
.asObservableSuccess().map { response ->
MangasPage(listOf(mangaDetailsParse(response)), false)
@ -237,6 +237,6 @@ class MangaTerra : ParsedHttpSource() {
companion object {
val dateFormat = SimpleDateFormat("dd-MM-yyyy", Locale("pt", "BR"))
val slugPrefix = "slug:"
const val PREFIX_SEARCH = "slug:"
}
}

View File

@ -34,5 +34,6 @@ class MangaTerraUrlActivity : Activity() {
exitProcess(0)
}
private fun slug(pathSegments: List<String>) = "${MangaTerra.slugPrefix}${pathSegments.last()}"
private fun slug(pathSegments: List<String>) =
"${MangaTerra.PREFIX_SEARCH}${pathSegments[pathSegments.size - 1]}"
}