Skip to content

Commit

Permalink
修复加载视频详细页时可能失败(Web接口)
Browse files Browse the repository at this point in the history
相关视频可能返回为 null
  • Loading branch information
aaa1115910 committed Dec 4, 2024
1 parent ba61c99 commit 28264c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ data class VideoDetail(
author = Author.fromVideoOwner(videoDetail.view.owner),
pages = videoDetail.view.pages.map { VideoPage.fromVideoPage(it) },
ugcSeason = videoDetail.view.ugcSeason?.let { UgcSeason.fromUgcSeason(it) },
relatedVideos = videoDetail.related.map { RelatedVideo.fromRelate(it) },
relatedVideos = videoDetail.related?.map { RelatedVideo.fromRelate(it) }
?: emptyList(),
redirectToEp = videoDetail.view.redirectUrl?.contains("ep") ?: false,
epid = videoDetail.view.redirectUrl?.split("ep", "?")?.get(1)?.toInt(),
argueTip = videoDetail.view.stat.argueMsg.takeIf { it.isNotEmpty() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data class VideoDetail(
//@SerialName("Reply")
//val reply:Any
@SerialName("Related")
val related: List<RelatedVideoInfo>,
val related: List<RelatedVideoInfo>?,
@SerialName("Spec")
val spec: JsonObject? = null,
@SerialName("hot_share")
Expand Down

0 comments on commit 28264c6

Please sign in to comment.