Skip to content

Commit e199194

Browse files
committed
修复 ugc 进度条图标可能为空的情况
fixed #190
1 parent c7e32ee commit e199194

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bili-api/src/main/kotlin/dev/aaa1115910/biliapi/entity/video/VideoDetail.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ data class VideoDetail(
183183
fun fromPlayerIcon(playerIcon: dev.aaa1115910.biliapi.http.entity.season.AppSeasonData.PlayerIcon?) =
184184
playerIcon?.let {
185185
PlayerIcon(
186-
idle = playerIcon.url2,
187-
moving = playerIcon.url1
186+
idle = playerIcon.url2 ?: return@let,
187+
moving = playerIcon.url1 ?: return@let
188188
)
189189
}
190190
}

bili-api/src/main/kotlin/dev/aaa1115910/biliapi/http/entity/season/AppSeasonData.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,12 @@ data class AppSeasonData(
325325
val ctime: Int,
326326
@SerialName("drag_data")
327327
val dragData: JsonElement? = null,
328-
val hash1: String,
329-
val hash2: String,
328+
val hash1: String? = null,
329+
val hash2: String? = null,
330330
@SerialName("no_drag_data")
331331
val noDragData: JsonElement? = null,
332-
val url1: String,
333-
val url2: String
332+
val url1: String? = null,
333+
val url2: String? = null
334334
)
335335

336336
@Serializable

0 commit comments

Comments
 (0)