Fix MAL main_picture
nullability breaking search if a result doesn't have a cover set (#1618)
* Fix MAL manga cover nullability If a manga doesn't have a cover, MAL doesn't provide the `main_picture` element in the API response at all. * Add CHANGELOG.md entry (cherry picked from commit d60802721b78870082af9445201338fbcfa0a780) # Conflicts: # CHANGELOG.md
This commit is contained in:
parent
fea11eaa06
commit
47b4be7fcf
@ -113,7 +113,7 @@ class MyAnimeListApi(
|
||||
summary = it.synopsis
|
||||
total_chapters = it.numChapters
|
||||
score = it.mean
|
||||
cover_url = it.covers.large
|
||||
cover_url = it.covers?.large.orEmpty()
|
||||
tracking_url = "https://myanimelist.net/manga/$remote_id"
|
||||
publishing_status = it.status.replace("_", " ")
|
||||
publishing_type = it.mediaType.replace("_", " ")
|
||||
|
@ -12,7 +12,7 @@ data class MALManga(
|
||||
val numChapters: Long,
|
||||
val mean: Double = -1.0,
|
||||
@SerialName("main_picture")
|
||||
val covers: MALMangaCovers,
|
||||
val covers: MALMangaCovers?,
|
||||
val status: String,
|
||||
@SerialName("media_type")
|
||||
val mediaType: String,
|
||||
|
Loading…
x
Reference in New Issue
Block a user