mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
fix person cards
This commit is contained in:
+26
-2
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import api from '@/api'
|
||||
import MediaCardListView from '@/views/discover/MediaCardListView.vue'
|
||||
import PersonCardListView from '@/views/discover/PersonCardListView.vue'
|
||||
|
||||
@@ -16,14 +17,37 @@ let title = route.query?.title?.toString()
|
||||
|
||||
// 类型
|
||||
const type = route.query?.type?.toString()
|
||||
|
||||
if (type === 'person') title = '演员:' + title
|
||||
|
||||
// 识别类型
|
||||
const RecognizeType = ref('themoviedb')
|
||||
|
||||
// 计算人物类型
|
||||
const PersonType = computed(() => {
|
||||
if (RecognizeType.value === 'douban') return 'douban'
|
||||
else if (RecognizeType.value === 'bangumi') return 'bangumi'
|
||||
else return 'tmdb'
|
||||
})
|
||||
|
||||
// 计算API路径
|
||||
function getApiPath(paths: string[] | string) {
|
||||
if (Array.isArray(paths)) return paths.join('/')
|
||||
else return paths
|
||||
}
|
||||
|
||||
// 加载系统设计
|
||||
async function loadSystemSettings() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get('system/env')
|
||||
if (result.success) RecognizeType.value = result.data?.RECOGNIZE_SOURCE
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
if (type === 'person') await loadSystemSettings()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -41,7 +65,7 @@ function getApiPath(paths: string[] | string) {
|
||||
<PersonCardListView
|
||||
v-if="type === 'person'"
|
||||
:apipath="getApiPath(props.paths || '')"
|
||||
type="tmdb"
|
||||
:type="PersonType"
|
||||
:params="route.query"
|
||||
/>
|
||||
<MediaCardListView v-else :apipath="getApiPath(props.paths || '')" :params="route.query" />
|
||||
|
||||
Reference in New Issue
Block a user