Fix Hentai Cafe deeplinking, fixes other deeplinks
This commit is contained in:
parent
dfabe1d2fa
commit
1dcf161131
@ -234,11 +234,11 @@
|
||||
<!-- Hentai Cafe -->
|
||||
<data
|
||||
android:host="hentai.cafe"
|
||||
android:pathPattern="/.*/.*"
|
||||
android:pathPrefix="/hc.fyi/"
|
||||
android:scheme="http" />
|
||||
<data
|
||||
android:host="hentai.cafe"
|
||||
android:pathPattern="/.*/.*"
|
||||
android:pathPrefix="/hc.fyi/"
|
||||
android:scheme="https" />
|
||||
|
||||
<!-- Tsumino -->
|
||||
|
@ -94,7 +94,7 @@ class HentaiCafe(delegate: HttpSource, val context: Context) :
|
||||
}.map {
|
||||
listOf(
|
||||
SChapter.create().apply {
|
||||
setUrlWithoutDomain("/manga/read/${it.readerId}/en/0/1/")
|
||||
url = "/manga/read/${it.readerId}/en/0/1/"
|
||||
name = "Chapter"
|
||||
chapter_number = 0.0f
|
||||
}
|
||||
@ -106,13 +106,11 @@ class HentaiCafe(delegate: HttpSource, val context: Context) :
|
||||
)
|
||||
|
||||
override fun mapUrlToMangaUrl(uri: Uri): String? {
|
||||
val lcFirstPathSegment = uri.pathSegments.firstOrNull()?.toLowerCase() ?: return null
|
||||
val lcFirstPathSegment = uri.pathSegments.firstOrNull()?.takeUnless { it.equals("manga", true) } ?: return null
|
||||
|
||||
return if (lcFirstPathSegment == "manga") {
|
||||
"https://hentai.cafe/${uri.pathSegments[2]}"
|
||||
} else {
|
||||
"https://hentai.cafe/$lcFirstPathSegment"
|
||||
}
|
||||
return if (lcFirstPathSegment.equals("hc.fyi", true)) {
|
||||
"/$lcFirstPathSegment/${uri.pathSegments[1]}"
|
||||
} else null
|
||||
}
|
||||
|
||||
override fun getDescriptionAdapter(controller: MangaController): HentaiCafeDescriptionAdapter {
|
||||
|
Loading…
x
Reference in New Issue
Block a user