MangaDex: Remove wildcard deeplinking (#10688)
* move more regexes into companion object * Remove wildcard domain intent too many issues. Might as well have the extension only support mangadex.org links * Increment mangadex.extVersionCode
This commit is contained in:
parent
b1f6d28cc1
commit
a60274e18b
|
@ -14,7 +14,6 @@
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
<data android:host="*.mangadex.org" />
|
|
||||||
<data android:host="mangadex.org" />
|
<data android:host="mangadex.org" />
|
||||||
|
|
||||||
<data
|
<data
|
||||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
||||||
extName = 'MangaDex'
|
extName = 'MangaDex'
|
||||||
pkgNameSuffix = 'all.mangadex'
|
pkgNameSuffix = 'all.mangadex'
|
||||||
extClass = '.MangaDexFactory'
|
extClass = '.MangaDexFactory'
|
||||||
extVersionCode = 154
|
extVersionCode = 155
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,10 @@ class MangaDexHelper() {
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
val markdownLinksRegex = "\\[([^]]+)\\]\\(([^)]+)\\)".toRegex()
|
val markdownLinksRegex = "\\[([^]]+)\\]\\(([^)]+)\\)".toRegex()
|
||||||
|
|
||||||
|
val titleSpecialCharactersRegex = "[^a-z0-9]+".toRegex()
|
||||||
|
|
||||||
|
val trailingHyphenRegex = "-+$".toRegex()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the token map to see if the md@home host is still valid
|
// Check the token map to see if the md@home host is still valid
|
||||||
|
@ -349,8 +353,8 @@ class MangaDexHelper() {
|
||||||
|
|
||||||
fun titleToSlug(title: String) = title.trim()
|
fun titleToSlug(title: String) = title.trim()
|
||||||
.toLowerCase(Locale.US)
|
.toLowerCase(Locale.US)
|
||||||
.replace("[^a-z0-9]+".toRegex(), "-")
|
.replace(titleSpecialCharactersRegex, "-")
|
||||||
.replace("-+$".toRegex(), "")
|
.replace(trailingHyphenRegex, "")
|
||||||
.split("-")
|
.split("-")
|
||||||
.reduce { accumulator, element ->
|
.reduce { accumulator, element ->
|
||||||
val currentSlug = "$accumulator-$element"
|
val currentSlug = "$accumulator-$element"
|
||||||
|
|
Loading…
Reference in New Issue