mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 00:36:41 +08:00
refactor(media): remove any cast for episode count fields
This commit is contained in:
@@ -18,9 +18,14 @@ import { hasPermission } from '@/utils/permission'
|
|||||||
// 国际化
|
// 国际化
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
interface MediaCardMedia extends MediaInfo {
|
||||||
|
total_episode?: number
|
||||||
|
episode_count?: number
|
||||||
|
}
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
media: Object as PropType<MediaInfo>,
|
media: Object as PropType<MediaCardMedia>,
|
||||||
width: String,
|
width: String,
|
||||||
height: String,
|
height: String,
|
||||||
})
|
})
|
||||||
@@ -233,11 +238,7 @@ async function handleCheckSubscribe() {
|
|||||||
async function handleCheckExists() {
|
async function handleCheckExists() {
|
||||||
try {
|
try {
|
||||||
// 对于总集数为 0 的电视剧季(TMDB 未返回有效集数),不展示“已入库”角标,避免误判
|
// 对于总集数为 0 的电视剧季(TMDB 未返回有效集数),不展示“已入库”角标,避免误判
|
||||||
const totalEpisode =
|
const totalEpisode = props.media?.total_episode ?? props.media?.episode_count ?? props.media?.number_of_episodes ?? 0
|
||||||
(props.media as any)?.total_episode ??
|
|
||||||
(props.media as any)?.episode_count ??
|
|
||||||
(props.media as any)?.number_of_episodes ??
|
|
||||||
0
|
|
||||||
|
|
||||||
if (props.media?.type === '电视剧' && totalEpisode === 0) {
|
if (props.media?.type === '电视剧' && totalEpisode === 0) {
|
||||||
isExists.value = false
|
isExists.value = false
|
||||||
|
|||||||
Reference in New Issue
Block a user