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.BROWSABLE" />
|
||||
|
||||
<data android:host="*.mangadex.org" />
|
||||
<data android:host="mangadex.org" />
|
||||
|
||||
<data
|
||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'MangaDex'
|
||||
pkgNameSuffix = 'all.mangadex'
|
||||
extClass = '.MangaDexFactory'
|
||||
extVersionCode = 154
|
||||
extVersionCode = 155
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,10 @@ class MangaDexHelper() {
|
|||
.build()
|
||||
|
||||
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
|
||||
|
@ -349,8 +353,8 @@ class MangaDexHelper() {
|
|||
|
||||
fun titleToSlug(title: String) = title.trim()
|
||||
.toLowerCase(Locale.US)
|
||||
.replace("[^a-z0-9]+".toRegex(), "-")
|
||||
.replace("-+$".toRegex(), "")
|
||||
.replace(titleSpecialCharactersRegex, "-")
|
||||
.replace(trailingHyphenRegex, "")
|
||||
.split("-")
|
||||
.reduce { accumulator, element ->
|
||||
val currentSlug = "$accumulator-$element"
|
||||
|
|
Loading…
Reference in New Issue