Fixes case where manga name ends with s. (#919)
This commit is contained in:
parent
6059b85e58
commit
aefe7b176a
@ -29,7 +29,7 @@ object ChapterRecognition {
|
||||
* Regex used to remove unwanted tags
|
||||
* Example Prison School 12 v.1 vol004 version1243 volume64 -R> Prison School 12
|
||||
*/
|
||||
private val unwanted = Regex("""(?:(v|ver|vol|version|volume|season|s).?[0-9]+)""")
|
||||
private val unwanted = Regex("""(?<![a-z])(v|ver|vol|version|volume|season|s).?[0-9]+""")
|
||||
|
||||
/**
|
||||
* Regex used to remove unwanted whitespace
|
||||
|
@ -440,4 +440,15 @@ class ChapterRecognitionTest {
|
||||
ChapterRecognition.parseChapterNumber(chapter, manga)
|
||||
assertThat(chapter.chapter_number).isEqualTo(20f)
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for chapters ending with s
|
||||
*/
|
||||
@Test fun chaptersEndingWithS() {
|
||||
createManga("One Outs")
|
||||
|
||||
createChapter("One Outs 001")
|
||||
ChapterRecognition.parseChapterNumber(chapter, manga)
|
||||
assertThat(chapter.chapter_number).isEqualTo(1f)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user