Comick: handle empty cover (#15862)

Comick: handle empty cover case
This commit is contained in:
mobi2002 2023-03-28 18:34:17 +05:00 committed by GitHub
parent 5c4ee8e887
commit 7a10d877d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Comick'
pkgNameSuffix = 'all.comickfun'
extClass = '.ComickFunFactory'
extVersionCode = 23
extVersionCode = 24
isNsfw = true
}

View File

@ -177,7 +177,11 @@ abstract class ComickFun(override val lang: String, private val comickFunLang: S
// appennding # at end as part of migration from slug to hid
url = "/comic/${data.hid}#"
title = data.title
thumbnail_url = "$cdnUrl/${data.md_covers[0].b2key}"
thumbnail_url = if (data.md_covers.isNotEmpty()) {
"$cdnUrl/${data.md_covers[0].b2key}"
} else {
"$baseUrl/static/failed_to_load.png"
}
}
},
/*
@ -212,7 +216,11 @@ abstract class ComickFun(override val lang: String, private val comickFunLang: S
description = beautifyDescription(mangaData.comic.desc)
genre = mangaData.genres.joinToString { it.name.trim() }
status = parseStatus(mangaData.comic.status)
thumbnail_url = "$cdnUrl/${mangaData.comic.md_covers[0].b2key}"
thumbnail_url = if (mangaData.comic.md_covers.isNotEmpty()) {
"$cdnUrl/${mangaData.comic.md_covers[0].b2key}"
} else {
"$baseUrl/static/failed_to_load.png"
}
}
}