MangaDex: use `matchEntire` to match UUID (#13600)
This commit is contained in:
parent
2214d390a4
commit
a062cfaeca
|
@ -6,10 +6,8 @@ import java.util.TimeZone
|
||||||
|
|
||||||
object MDConstants {
|
object MDConstants {
|
||||||
|
|
||||||
const val UUID_REGEX = "[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}"
|
val uuidRegex =
|
||||||
|
Regex("[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}")
|
||||||
val uuidRegex = UUID_REGEX.toRegex()
|
|
||||||
val onlyUuidRegex = "^$UUID_REGEX$".toRegex()
|
|
||||||
|
|
||||||
const val mangaLimit = 20
|
const val mangaLimit = 20
|
||||||
const val latestChapterLimit = 100
|
const val latestChapterLimit = 100
|
||||||
|
|
|
@ -68,7 +68,7 @@ class MangaDexHelper(private val lang: String) {
|
||||||
/**
|
/**
|
||||||
* Check if the string is a valid uuid
|
* Check if the string is a valid uuid
|
||||||
*/
|
*/
|
||||||
fun isUuid(text: String) = text.matches(MDConstants.onlyUuidRegex)
|
fun isUuid(text: String) = MDConstants.uuidRegex.matchEntire(text) != null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the manga offset pages are 1 based, so subtract 1
|
* Get the manga offset pages are 1 based, so subtract 1
|
||||||
|
|
Loading…
Reference in New Issue