@@ -67,6 +67,25 @@ const subscribeState = ref<string>(props.media?.state ?? 'P')
6767// 上一次更新时间
6868const lastUpdateText = computed (() => (props .media ?.last_update ? formatDateDifference (props .media .last_update ) : ' ' ))
6969
70+ // 判断后端数字/布尔开关是否启用
71+ function isEnabledFlag(value : any ) {
72+ return value === true || value === 1 || value === ' 1'
73+ }
74+
75+ // 订阅列表接口通常返回中文媒体类型,插件或缓存数据可能只保留剧集字段
76+ function isTvSubscribe(media ? : Subscribe ) {
77+ return media ?.type === ' 电视剧' || media ?.type === ' tv' || !! media ?.season || !! media ?.total_episode
78+ }
79+
80+ // TV 洗版订阅在卡片上展示分集或全集短标签
81+ const bestVersionModeLabel = computed (() => {
82+ if (! isEnabledFlag (props .media ?.best_version ) || ! isTvSubscribe (props .media )) return ' '
83+
84+ return isEnabledFlag (props .media ?.best_version_full )
85+ ? t (' subscribe.bestVersionWholeShort' )
86+ : t (' subscribe.bestVersionEpisodeShort' )
87+ })
88+
7089// 图片加载完成响应
7190function imageLoadHandler() {
7291 imageLoaded .value = true
@@ -428,6 +447,15 @@ function handleCardClick() {
428447 {{ (props.media?.total_episode || 0) - (props.media?.lack_episode || 0) }} /
429448 {{ props.media?.total_episode }}
430449 </div >
450+ <VChip
451+ v-if =" bestVersionModeLabel"
452+ size =" x-small"
453+ color =" primary"
454+ variant =" flat"
455+ class =" me-2 flex-shrink-0"
456+ >
457+ {{ bestVersionModeLabel }}
458+ </VChip >
431459 <VIcon v-if =" props.media?.username && props.sortable" icon =" mdi-account" size =" small" color =" white" class =" flex-shrink-0 me-1" />
432460 <IconBtn v-else-if =" props.media?.username" icon =" mdi-account" size =" small" color =" white" class =" flex-shrink-0" />
433461 <!-- 用户名过长时限制在卡片宽度内,并用省略号展示剩余内容 -->
0 commit comments