Add intent for Guya proxies (#6276)

This commit is contained in:
Andreas 2021-03-24 18:46:39 +01:00 committed by GitHub
parent 374820d365
commit a4e5480260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View File

@ -17,6 +17,11 @@
android:host="guya.moe" android:host="guya.moe"
android:pathPattern="/read/manga/..*" android:pathPattern="/read/manga/..*"
android:scheme="https" /> android:scheme="https" />
<data
android:host="guya.moe"
android:pathPattern="/proxy/..*"
android:scheme="https" />
</intent-filter> </intent-filter>
</activity> </activity>
</application> </application>

View File

@ -5,7 +5,7 @@ ext {
extName = 'Guya' extName = 'Guya'
pkgNameSuffix = "en.guya" pkgNameSuffix = "en.guya"
extClass = '.Guya' extClass = '.Guya'
extVersionCode = 15 extVersionCode = 16
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -19,12 +19,24 @@ class GuyaUrlActivity : Activity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
val pathSegments = intent?.data?.pathSegments val pathSegments = intent?.data?.pathSegments
if (pathSegments != null && pathSegments.size >= 3) { if (pathSegments != null && pathSegments.size >= 3) {
val slug = pathSegments[2] Log.d("GuyaUrlActivity", pathSegments[0])
val query = when (pathSegments[0]) {
"proxy" -> {
val source = pathSegments[1]
val id = pathSegments[2]
"${Guya.PROXY_PREFIX}$source/$id"
}
else -> {
val slug = pathSegments[2]
"${Guya.SLUG_PREFIX}$slug"
}
}
// Gotta do it like this since slug title != actual title // Gotta do it like this since slug title != actual title
val mainIntent = Intent().apply { val mainIntent = Intent().apply {
action = "eu.kanade.tachiyomi.SEARCH" action = "eu.kanade.tachiyomi.SEARCH"
putExtra("query", "${Guya.SLUG_PREFIX}$slug") putExtra("query", query)
putExtra("filter", packageName) putExtra("filter", packageName)
} }