mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
minor adjustments to ChapterRecognition
This commit is contained in:
parent
dbc7098820
commit
e6782a63a2
1 changed files with 5 additions and 6 deletions
|
@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.util.chapter
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.source.model.SChapter
|
import eu.kanade.tachiyomi.source.model.SChapter
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import java.util.Locale
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* -R> = regex conversion.
|
* -R> = regex conversion.
|
||||||
|
@ -45,7 +44,7 @@ object ChapterRecognition {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get chapter title with lower case
|
// Get chapter title with lower case
|
||||||
var name = chapter.name.lowercase(Locale.getDefault())
|
var name = chapter.name.lowercase()
|
||||||
|
|
||||||
// Remove comma's from chapter.
|
// Remove comma's from chapter.
|
||||||
name = name.replace(',', '.')
|
name = name.replace(',', '.')
|
||||||
|
@ -78,7 +77,7 @@ object ChapterRecognition {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove manga title from chapter title.
|
// Remove manga title from chapter title.
|
||||||
val nameWithoutManga = name.replace(manga.originalTitle.lowercase(Locale.getDefault()), "").trim()
|
val nameWithoutManga = name.replace(manga.originalTitle.lowercase(), "").trim()
|
||||||
|
|
||||||
// Check if first value is number after title remove.
|
// Check if first value is number after title remove.
|
||||||
if (updateChapter(withoutManga.find(nameWithoutManga), chapter)) {
|
if (updateChapter(withoutManga.find(nameWithoutManga), chapter)) {
|
||||||
|
@ -133,11 +132,11 @@ object ChapterRecognition {
|
||||||
return .97f
|
return .97f
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alpha[0] == '.') {
|
return if (alpha[0] == '.') {
|
||||||
// Take value after (.)
|
// Take value after (.)
|
||||||
return parseAlphaPostFix(alpha[1])
|
parseAlphaPostFix(alpha[1])
|
||||||
} else {
|
} else {
|
||||||
return parseAlphaPostFix(alpha[0])
|
parseAlphaPostFix(alpha[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue