Fixes case where manga name ends with s. (#919)
Cette révision appartient à :
Parent
6059b85e58
révision
aefe7b176a
2 fichiers modifiés avec 12 ajouts et 1 suppressions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Référencer dans un nouveau ticket