fix: Kitsu synopsis nullability

This time, the Kitsu API docs are silent on whether this field (or
any other field) can be null/undefined/etc, but it can happen and
caused an error during search and update. This change just ensures the
attribute is nullable and is set to an empty String when it is null.
This commit is contained in:
MajorTanya 2024-09-17 18:07:43 +07:00 committed by Ahmad Ansori Palembani
parent 0d8276040f
commit 33ec0d0f91
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -25,7 +25,7 @@ data class KitsuListSearchResult(
title = manga.canonicalTitle
total_chapters = manga.chapterCount ?: 0
cover_url = manga.posterImage?.original ?: ""
summary = manga.synopsis
summary = manga.synopsis ?: ""
tracking_url = KitsuApi.mangaUrl(media_id)
publishing_status = manga.status
publishing_type = manga.mangaType ?: ""
@ -73,7 +73,7 @@ data class KitsuListSearchItemIncludedAttributes(
val chapterCount: Long?,
val mangaType: String?,
val posterImage: KitsuSearchItemCover?,
val synopsis: String,
val synopsis: String?,
val startDate: String?,
val status: String,
)