This commit is contained in:
beerpsi 2022-09-08 18:52:03 +07:00 committed by GitHub
parent 3ff513e472
commit d30e215b97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'YuriNeko'
pkgNameSuffix = 'vi.yurineko'
extClass = '.YuriNeko'
extVersionCode = 1
extVersionCode = 2
isNsfw = true
}

View File

@ -195,7 +195,7 @@ class YuriNeko : HttpSource() {
}
override fun getFilterList() = FilterList(
Filter.Header("Lưu ý rằng không thể vừa tìm kiếm vừa lọc bằng tag cùng lúc."),
Filter.Header("Lưu ý rằng không thể vừa tìm kiếm vừa lọc bằng tag."),
Filter.Header("Tìm kiếm sẽ được ưu tiên."),
UriPartFilter("Tag", getGenreList())
)

View File

@ -11,7 +11,7 @@ val DATE_FORMATTER = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US)
timeZone = TimeZone.getTimeZone("Asia/Ho_Chi_Minh")
}
val FLOATING_NUMBER_REGEX = Regex("""([+-]?(?:[0-9]*[.])?[0-9]+)""")
val CHAPTER_NUMBER_REGEX = Regex("""[+\-]?([0-9]*[\.])?[0-9]+""", RegexOption.IGNORE_CASE)
@Serializable
data class ChapterDto(
@ -32,11 +32,11 @@ data class ChapterDto(
}.getOrNull() ?: 0L
}
val match = FLOATING_NUMBER_REGEX.find(dto.name)
chapter_number = if (dto.name.lowercase().startsWith("vol")) {
match?.groups?.get(2)
val match = CHAPTER_NUMBER_REGEX.findAll(dto.name)
chapter_number = if (match.count() > 1 && dto.name.lowercase().startsWith("vol")) {
match.elementAt(1)
} else {
match?.groups?.get(1)
match.elementAtOrNull(0)
}?.value?.toFloat() ?: -1f
scanlator = teams
}