Skip to content

Commit

Permalink
fix: 获取直播地址失败的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
muedsa committed Dec 17, 2024
1 parent 5143dfe commit 92e3720
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import kotlinx.serialization.Serializable
@Serializable
data class LivePlayUrl(
@SerialName("current_quality") val currentQuality: Int = 0,
@SerialName("accept_quality") val acceptQuality: List<String> = emptyList(),
@SerialName("accept_quality") val acceptQuality: List<String>? = null,
@SerialName("current_qn") val currentQn: Int = 0,
@SerialName("accept_qn") val acceptQn: List<LivePlayQn> = emptyList(),
val durl: List<LivePlayUrlDurl> = emptyList(),
@SerialName("accept_qn") val acceptQn: List<LivePlayQn>? = null,
val durl: List<LivePlayUrlDurl>? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class MediaDetailService(
platform = "android",
quality = 4,
)
if (resp.code == 0L && resp.data != null) {
if (resp.code == 0L && resp.data?.durl != null) {
listOf(
MediaPlaySource(
id = "bilibili_live",
Expand All @@ -424,12 +424,12 @@ class MediaDetailService(
MediaPlaySource(
id = "bilibili_live",
name = "哔哩哔哩直播",
episodeList = resp.data!!.durl.mapIndexed { index, durl ->
episodeList = listOf(
MediaEpisode(
id = "$MEDIA_ID_LIVE_ROOM_PREFIX${roomInfo.roomId}",
name = if (resp.message.isNotBlank()) resp.message else "获取直播地址失败",
)
}
)
)
)
}
Expand Down

0 comments on commit 92e3720

Please sign in to comment.