Improve getting staff name with Anilist

This commit is contained in:
Cuong-Tran 2025-04-19 23:45:59 +07:00
parent 98f93bfbad
commit e398d9b156
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2

View file

@ -374,12 +374,12 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
description = media.description?.htmlDecode()?.ifEmpty { null },
authors = media.staff.edges
.filter { "Story" in it.role }
.mapNotNull { it.node.name.userPreferred }
.mapNotNull { it.node.name() }
.joinToString(", ")
.ifEmpty { null },
artists = media.staff.edges
.filter { "Art" in it.role }
.mapNotNull { it.node.name.userPreferred }
.mapNotNull { it.node.name() }
.joinToString(", ")
.ifEmpty { null },
)