Update basic filter for sources that include space between numbers

Wasnts matching on  vol. 1 ch. 10 previously so mangadex last chapter was showing volume number.
This commit is contained in:
Carlos Escobedo 2018-01-24 20:03:22 -05:00
parent 55b7d5025b
commit b7903023b6

View File

@ -11,7 +11,7 @@ object ChapterRecognition {
* All cases with Ch.xx * All cases with Ch.xx
* Mokushiroku Alice Vol.1 Ch. 4: Misrepresentation -R> 4 * Mokushiroku Alice Vol.1 Ch. 4: Misrepresentation -R> 4
*/ */
private val basic = Regex("""(?<=ch\.)([0-9]+)(\.[0-9]+)?(\.?[a-z]+)?""") private val basic = Regex("""(?<=ch\.) *([0-9]+)(\.[0-9]+)?(\.?[a-z]+)?""")
/** /**
* Regex used when only one number occurrence * Regex used when only one number occurrence
@ -37,6 +37,7 @@ object ChapterRecognition {
*/ */
private val unwantedWhiteSpace = Regex("""(\s)(extra|special|omake)""") private val unwantedWhiteSpace = Regex("""(\s)(extra|special|omake)""")
fun parseChapterNumber(chapter: SChapter, manga: SManga) { fun parseChapterNumber(chapter: SChapter, manga: SManga) {
// If chapter number is known return. // If chapter number is known return.
if (chapter.chapter_number == -2f || chapter.chapter_number > -1f) if (chapter.chapter_number == -2f || chapter.chapter_number > -1f)