Comick: thumbnails (#16135)

This commit is contained in:
mobi2002 2023-04-24 04:09:15 +05:00 committed by GitHub
parent df726a5122
commit 7e37c68ba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 12 deletions

View File

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

View File

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

View File

@ -11,7 +11,7 @@ data class Manga(
@Serializable @Serializable
data class MDcovers( data class MDcovers(
val b2key: String, val b2key: String?,
) )
@Serializable @Serializable