[RU]Remanga show chapters when licensed (#13948)

This commit is contained in:
Eshlender 2022-10-23 03:15:43 +05:00 committed by GitHub
parent eb5b385a43
commit 3c49304709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Remanga' extName = 'Remanga'
pkgNameSuffix = 'ru.remanga' pkgNameSuffix = 'ru.remanga'
extClass = '.Remanga' extClass = '.Remanga'
extVersionCode = 57 extVersionCode = 58
} }
dependencies { dependencies {

View File

@ -153,7 +153,6 @@ class Remanga : ConfigurableSource, HttpSource() {
thumbnail_url = "$baseUrl/icon.png" thumbnail_url = "$baseUrl/icon.png"
} }
) )
return MangasPage(mangas, page.props.page < page.props.total_pages) return MangasPage(mangas, page.props.page < page.props.total_pages)
} }
} }
@ -340,12 +339,12 @@ class Remanga : ConfigurableSource, HttpSource() {
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> { override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
val branch = branches.getOrElse(manga.title) { mangaBranches(manga) } val branch = branches.getOrElse(manga.title) { mangaBranches(manga) }
return when { return when {
manga.status == SManga.LICENSED && branch.isEmpty() -> {
Observable.error(Exception("Лицензировано - Нет глав"))
}
branch.isEmpty() -> { branch.isEmpty() -> {
return Observable.just(listOf()) return Observable.just(listOf())
} }
manga.status == SManga.LICENSED -> {
Observable.error(Exception("Лицензировано - Нет глав"))
}
else -> { else -> {
val selectedBranch = branch.maxByOrNull { selector(it) }!! val selectedBranch = branch.maxByOrNull { selector(it) }!!
return (1..(selectedBranch.count_chapters / 100 + 1)).map { return (1..(selectedBranch.count_chapters / 100 + 1)).map {