[F] Fix corner case when only one song is pressent

matching
Azalea 2024-12-27 03:26:09 -05:00
parent a731687607
commit 159b36607a
1 changed files with 1 additions and 5 deletions

View File

@ -234,11 +234,7 @@ fun ChusanServletController.init() {
else -> null
}?.let { db.userGeneralData.findByUser_Card_ExtIdAndPropertyKey(uid, it)() }?.propertyValue
val lst = fav?.let {
if (it.isNotBlank() && it.contains(",")) it.split(",").map { it.int }
else null
} ?: emptyList()
val lst = fav?.ifBlank { null }?.split(",")?.map { it.int } ?: emptyList()
mapOf("userId" to uid, "kind" to kind, "length" to lst.size, "nextIndex" to -1, "userFavoriteItemList" to lst)
}