Comico: make some fields optional (#11084)

This commit is contained in:
ObserverOfTime 2022-03-14 12:21:27 +02:00 committed by GitHub
parent 55fe02563c
commit e00a54ca3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Comico'
pkgNameSuffix = 'all.comico'
extClass = '.ComicoFactory'
extVersionCode = 2
extVersionCode = 3
isNsfw = true
}

View File

@ -99,7 +99,7 @@ open class Comico(
GET(apiUrl + chapter.url, apiHeaders)
override fun imageRequest(page: Page) =
GET(page.imageUrl!!.also { android.util.Log.w("URL", it) }, imgHeaders)
GET(page.imageUrl!!, imgHeaders)
override fun latestUpdatesParse(response: Response) =
popularMangaParse(response)
@ -117,10 +117,10 @@ open class Comico(
"completed" -> SManga.COMPLETED
else -> SManga.ONGOING
}
author = it.authors.filter { it.isAuthor }.joinToString()
artist = it.authors.filter { it.isArtist }.joinToString()
author = it.authors?.filter { it.isAuthor }?.joinToString()
artist = it.authors?.filter { it.isArtist }?.joinToString()
genre = buildString {
it.genres.joinTo(this)
it.genres?.joinTo(this)
if (it.mature) append(", Mature")
if (it.original) append(", Original")
if (it.exclusive) append(", Exclusive")

View File

@ -7,12 +7,12 @@ data class ContentInfo(
val id: Int,
val name: String,
val description: String,
val authors: List<Author>,
val genres: List<Genre>,
val original: Boolean,
val exclusive: Boolean,
val mature: Boolean,
val status: String? = null,
val genres: List<Genre>? = null,
val authors: List<Author>? = null,
private val thumbnails: List<Thumbnail>,
) {
val cover: String