PeachScan: Fix deeplink support (#3334)
* Adds support for any path in peachscan * Deeplink: Ignore manga collection path * Cleanup
This commit is contained in:
parent
4dba7261af
commit
9e8bbb7f0b
|
@ -2,7 +2,7 @@ plugins {
|
||||||
id("lib-multisrc")
|
id("lib-multisrc")
|
||||||
}
|
}
|
||||||
|
|
||||||
baseVersionCode = 8
|
baseVersionCode = 9
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("com.github.tachiyomiorg:image-decoder:e08e9be535")
|
compileOnly("com.github.tachiyomiorg:image-decoder:e08e9be535")
|
||||||
|
|
|
@ -86,7 +86,7 @@ abstract class PeachScan(
|
||||||
|
|
||||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||||
if (query.startsWith(URL_SEARCH_PREFIX)) {
|
if (query.startsWith(URL_SEARCH_PREFIX)) {
|
||||||
val manga = SManga.create().apply { url = "/${query.substringAfter(URL_SEARCH_PREFIX)}/" }
|
val manga = SManga.create().apply { url = query.substringAfter(URL_SEARCH_PREFIX) }
|
||||||
return client.newCall(mangaDetailsRequest(manga))
|
return client.newCall(mangaDetailsRequest(manga))
|
||||||
.asObservableSuccess()
|
.asObservableSuccess()
|
||||||
.map {
|
.map {
|
||||||
|
|
|
@ -10,12 +10,11 @@ import kotlin.system.exitProcess
|
||||||
class PeachScanUrlActivity : Activity() {
|
class PeachScanUrlActivity : Activity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
val pathSegments = intent?.data?.pathSegments
|
val path = intent?.data?.path
|
||||||
|
if (path != null) {
|
||||||
if (pathSegments != null && pathSegments.size >= 1) {
|
|
||||||
val mainIntent = Intent().apply {
|
val mainIntent = Intent().apply {
|
||||||
action = "eu.kanade.tachiyomi.SEARCH"
|
action = "eu.kanade.tachiyomi.SEARCH"
|
||||||
putExtra("query", "${slug(pathSegments)}")
|
putExtra("query", "${PeachScan.URL_SEARCH_PREFIX}$path")
|
||||||
putExtra("filter", packageName)
|
putExtra("filter", packageName)
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -30,13 +29,4 @@ class PeachScanUrlActivity : Activity() {
|
||||||
finish()
|
finish()
|
||||||
exitProcess(0)
|
exitProcess(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun slug(pathSegments: MutableList<String>): String? {
|
|
||||||
return if (pathSegments.size >= 1) {
|
|
||||||
val slug = pathSegments[0]
|
|
||||||
"${PeachScan.URL_SEARCH_PREFIX}$slug"
|
|
||||||
} else {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue