Add support to the cancelled status in TaoSect. (#12122)

This commit is contained in:
Alessandro Jean 2022-06-07 21:46:56 -03:00 committed by GitHub
parent 4f83ca4c81
commit 1de4b7e286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Tao Sect'
pkgNameSuffix = 'pt.taosect'
extClass = '.TaoSect'
extVersionCode = 18
extVersionCode = 19
isNsfw = true
}

View File

@ -100,7 +100,7 @@ class TaoSect : HttpSource() {
override fun latestUpdatesParse(response: Response): MangasPage {
val result = response.parseAs<List<TaoSectChapterDto>>()
if (result.isNullOrEmpty()) {
if (result.isEmpty()) {
return MangasPage(emptyList(), hasNextPage = false)
}
@ -186,7 +186,7 @@ class TaoSect : HttpSource() {
override fun mangaDetailsParse(response: Response): SManga {
val result = response.parseAs<List<TaoSectProjectDto>>()
if (result.isNullOrEmpty()) {
if (result.isEmpty()) {
throw Exception(PROJECT_NOT_FOUND)
}
@ -224,7 +224,7 @@ class TaoSect : HttpSource() {
override fun chapterListParse(response: Response): List<SChapter> {
val result = response.parseAs<List<TaoSectChapterDto>>()
if (result.isNullOrEmpty()) {
if (result.isEmpty()) {
throw Exception(CHAPTERS_NOT_FOUND)
}
@ -264,7 +264,7 @@ class TaoSect : HttpSource() {
override fun pageListParse(response: Response): List<Page> {
val result = response.parseAs<TaoSectChapterDto>()
if (result.pages.isNullOrEmpty()) {
if (result.pages.isEmpty()) {
return emptyList()
}
@ -358,6 +358,7 @@ class TaoSect : HttpSource() {
private fun String.toStatus() = when (this) {
"Ativos" -> SManga.ONGOING
"Finalizados", "Oneshots" -> SManga.COMPLETED
"Cancelados" -> SManga.CANCELLED
else -> SManga.UNKNOWN
}