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.

Co-authored-by: MajorTanya <39014446+MajorTanya@users.noreply.github.com>
This commit is contained in:
Secozzi 2024-10-30 12:21:59 +01:00
parent 12ae69f06e
commit 34deae5e27
No known key found for this signature in database
GPG key ID: DD93E0B3A962AA86

View file

@ -26,7 +26,7 @@ data class KitsuListSearchResult(
title = manga.canonicalTitle title = manga.canonicalTitle
total_chapters = manga.chapterCount ?: 0 total_chapters = manga.chapterCount ?: 0
cover_url = manga.posterImage?.original ?: "" cover_url = manga.posterImage?.original ?: ""
summary = manga.synopsis summary = manga.synopsis ?: ""
tracking_url = KitsuApi.mangaUrl(remote_id) tracking_url = KitsuApi.mangaUrl(remote_id)
publishing_status = manga.status publishing_status = manga.status
publishing_type = manga.mangaType ?: "" publishing_type = manga.mangaType ?: ""
@ -59,7 +59,7 @@ data class KitsuListSearchResult(
title = anime.canonicalTitle title = anime.canonicalTitle
total_episodes = anime.episodeCount ?: 0 total_episodes = anime.episodeCount ?: 0
cover_url = anime.posterImage?.original ?: "" cover_url = anime.posterImage?.original ?: ""
summary = anime.synopsis summary = anime.synopsis ?: ""
tracking_url = KitsuApi.animeUrl(remote_id) tracking_url = KitsuApi.animeUrl(remote_id)
publishing_status = anime.status publishing_status = anime.status
publishing_type = anime.showType ?: "" publishing_type = anime.showType ?: ""
@ -109,7 +109,7 @@ data class KitsuListSearchItemIncludedAttributes(
val mangaType: String?, val mangaType: String?,
val showType: String?, val showType: String?,
val posterImage: KitsuSearchItemCover?, val posterImage: KitsuSearchItemCover?,
val synopsis: String, val synopsis: String?,
val startDate: String?, val startDate: String?,
val status: String, val status: String,
) )