Remove episode number from episode title like saikou (#119)

* Add files via upload

* Add files via upload

* Add files via upload

* use existing robust episode regex

* use existing robust episode regex

* use existing robust episode regex

* use existing robust episode regex

* allow external use of manga chapter regex as well

---------

Co-authored-by: rebel onion <87634197+rebelonion@users.noreply.github.com>
This commit is contained in:
Yutatsu 2024-01-13 07:51:10 +06:00 committed by GitHub
parent 038b8f7ff7
commit 97cd3dd43b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 84 additions and 75 deletions

View file

@ -5,8 +5,8 @@ import java.util.regex.Pattern
class MangaNameAdapter {
companion object {
val chapterRegex = "(chapter|chap|ch|c)[\\s:.\\-]*([\\d]+\\.?[\\d]*)[\\s:.\\-]*"
fun findChapterNumber(text: String): Float? {
val regex = "(chapter|chap|ch|c)[\\s:.\\-]*([\\d]+\\.?[\\d]*)"
val pattern: Pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE)
val matcher: Matcher = pattern.matcher(text)
@ -17,4 +17,4 @@ class MangaNameAdapter {
}
}
}
}
}