Skip to content

Commit

Permalink
修复动态列表中无法显示动态视频的标题(App接口)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaa1115910 committed Sep 17, 2024
1 parent 5ea9a63 commit 39d34a1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ data class DynamicVideo(

fun fromDynamicVideoItem(item: bilibili.app.dynamic.v2.DynamicItem): DynamicVideo {
val author =
item.modulesList.first { it.moduleType == DynModuleType.module_author }.moduleAuthor.author
item.modulesList.first { it.moduleType == DynModuleType.module_author }.moduleAuthor
val dynamic =
item.modulesList.first { it.moduleType == DynModuleType.module_dynamic }.moduleDynamic
val desc =
item.modulesList.firstOrNull { it.moduleType == DynModuleType.module_desc }?.moduleDesc
val isDynamicVideo = desc?.text?.startsWith("动态视频") ?: false
val isDynamicVideo = author?.ptimeLabelText?.contains("动态视频") ?: false
when (dynamic.moduleItemCase) {
ModuleDynamic.ModuleItemCase.DYN_ARCHIVE -> {
val archive = dynamic.dynArchive
Expand All @@ -98,7 +98,7 @@ data class DynamicVideo(
cid = archive.cid,
title = if (!isDynamicVideo) archive.title else desc!!.text.substring(5),
cover = archive.cover,
author = author.name,
author = author.author.name,
duration = convertStringTimeToSeconds(archive.coverLeftText1),
play = convertStringPlayCountToNumberPlayCount(archive.coverLeftText2),
danmaku = convertStringPlayCountToNumberPlayCount(archive.coverLeftText3)
Expand All @@ -115,7 +115,7 @@ data class DynamicVideo(
seasonId = pgc.seasonId.toInt(),
title = pgc.title,
cover = pgc.cover,
author = author.name,
author = author.author.name,
duration = convertStringTimeToSeconds(pgc.coverLeftText1),
play = convertStringPlayCountToNumberPlayCount(pgc.coverLeftText2),
danmaku = convertStringPlayCountToNumberPlayCount(pgc.coverLeftText3)
Expand Down

0 comments on commit 39d34a1

Please sign in to comment.