[RU]YagamiProject universal chapter_number (#7883)

* [RU]YagamiProject universal chapter_number

* restart
This commit is contained in:
Eugene 2021-06-26 16:16:28 +05:00 committed by GitHub
parent 5c3565ac26
commit 35a7ec0ac9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'YagamiProject' extName = 'YagamiProject'
pkgNameSuffix = 'ru.yagamiproject' pkgNameSuffix = 'ru.yagamiproject'
extClass = '.YagamiProject' extClass = '.YagamiProject'
extVersionCode = 2 extVersionCode = 3
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -118,10 +118,9 @@ class YagamiProject : ParsedHttpSource() {
chapter.attr("title").isNullOrBlank() -> chapter.text() chapter.attr("title").isNullOrBlank() -> chapter.text()
else -> chapter.attr("title") else -> chapter.attr("title")
} }
val numout = name.substringBefore(":").substringAfterLast(" ").substringAfterLast("")
chapter_number = when { chapter_number = when {
name.contains("Глава") -> name.substringAfter("Глава ").substringBefore(":").toFloat() numout.contains(Regex("^[0-9]+")) -> numout.toFloat()
name.contains("Акт") -> name.substringAfter("Акт").substringBefore(":").replace("", "").toFloat()
else -> 0F else -> 0F
} }
setUrlWithoutDomain(chapter.attr("href")) setUrlWithoutDomain(chapter.attr("href"))
@ -162,7 +161,6 @@ class YagamiProject : ParsedHttpSource() {
} }
// Filters // Filters
override fun getFilterList() = FilterList( override fun getFilterList() = FilterList(
Filter.Header("ПРИМЕЧАНИЕ: Фильтры исключают другдруга!"), Filter.Header("ПРИМЕЧАНИЕ: Фильтры исключают другдруга!"),
CategoryList(categoriesName), CategoryList(categoriesName),