From d30e215b97c67cb471cc1625c14efcca7a53edaf Mon Sep 17 00:00:00 2001 From: beerpsi <92439990+beerpiss@users.noreply.github.com> Date: Thu, 8 Sep 2022 18:52:03 +0700 Subject: [PATCH] fix #13380 (#13382) --- src/vi/yurineko/build.gradle | 2 +- .../kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt | 2 +- .../tachiyomi/extension/vi/yurineko/dto/ChapterDto.kt | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vi/yurineko/build.gradle b/src/vi/yurineko/build.gradle index 5e76d547a..5144545c2 100644 --- a/src/vi/yurineko/build.gradle +++ b/src/vi/yurineko/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'YuriNeko' pkgNameSuffix = 'vi.yurineko' extClass = '.YuriNeko' - extVersionCode = 1 + extVersionCode = 2 isNsfw = true } diff --git a/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt b/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt index 73b46feec..5a1f1b614 100644 --- a/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt +++ b/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/YuriNeko.kt @@ -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()) ) diff --git a/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/dto/ChapterDto.kt b/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/dto/ChapterDto.kt index b41a2980c..90a7360c1 100644 --- a/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/dto/ChapterDto.kt +++ b/src/vi/yurineko/src/eu/kanade/tachiyomi/extension/vi/yurineko/dto/ChapterDto.kt @@ -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 }