mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(myanimelist): Fix nullability and fallback to medium cover if large
cover is null
This commit is contained in:
parent
e06b28a60e
commit
a3672be728
2 changed files with 4 additions and 3 deletions
|
@ -96,7 +96,7 @@ class MyAnimeListApi(private val client: OkHttpClient, interceptor: MyAnimeListI
|
||||||
title = it.title
|
title = it.title
|
||||||
summary = it.synopsis
|
summary = it.synopsis
|
||||||
total_chapters = it.numChapters
|
total_chapters = it.numChapters
|
||||||
cover_url = it.covers.large
|
cover_url = (it.covers?.large ?: it.covers?.medium).orEmpty()
|
||||||
tracking_url = "https://myanimelist.net/manga/$media_id"
|
tracking_url = "https://myanimelist.net/manga/$media_id"
|
||||||
publishing_status = it.status.replace("_", " ")
|
publishing_status = it.status.replace("_", " ")
|
||||||
publishing_type = it.mediaType.replace("_", " ")
|
publishing_type = it.mediaType.replace("_", " ")
|
||||||
|
|
|
@ -12,7 +12,7 @@ data class MALManga(
|
||||||
val numChapters: Long,
|
val numChapters: Long,
|
||||||
val mean: Double = -1.0,
|
val mean: Double = -1.0,
|
||||||
@SerialName("main_picture")
|
@SerialName("main_picture")
|
||||||
val covers: MALMangaCovers,
|
val covers: MALMangaCovers?,
|
||||||
val status: String,
|
val status: String,
|
||||||
@SerialName("media_type")
|
@SerialName("media_type")
|
||||||
val mediaType: String,
|
val mediaType: String,
|
||||||
|
@ -22,5 +22,6 @@ data class MALManga(
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class MALMangaCovers(
|
data class MALMangaCovers(
|
||||||
val large: String = "",
|
val large: String?,
|
||||||
|
val medium: String,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue