From 705847278456eb4e4ae8f8f01e3748d836bab102 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 3 Sep 2023 19:25:46 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=AA=92=E4=BD=93=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/MediaInfoCard.vue | 147 +++++++++++++++++++++++++ src/components/filebrowser/List.vue | 127 +-------------------- src/views/system/NameTestView.vue | 135 +---------------------- 3 files changed, 151 insertions(+), 258 deletions(-) create mode 100644 src/components/cards/MediaInfoCard.vue diff --git a/src/components/cards/MediaInfoCard.vue b/src/components/cards/MediaInfoCard.vue new file mode 100644 index 00000000..45e1deb6 --- /dev/null +++ b/src/components/cards/MediaInfoCard.vue @@ -0,0 +1,147 @@ + + + diff --git a/src/components/filebrowser/List.vue b/src/components/filebrowser/List.vue index 349cce99..39a83b71 100644 --- a/src/components/filebrowser/List.vue +++ b/src/components/filebrowser/List.vue @@ -9,6 +9,7 @@ import { formatBytes } from '@core/utils/formatters' import type { Context, EndPoints, FileItem } from '@/api/types' import store from '@/store' import api from '@/api' +import MediaInfoCard from '@/components/cards/MediaInfoCard.vue' // 输入参数 const inProps = defineProps({ @@ -341,13 +342,6 @@ async function recognize(path: string) { } } -// TMDB图片转换为w500大小 -function getW500Image(url = '') { - if (!url) - return '' - return url.replace('original', 'w500') -} - // 弹出菜单 const dropdownItems = ref([ { @@ -759,124 +753,7 @@ onMounted(() => { -
- -
-
- - - -
- -
- - - {{ nameTestResult?.media_info?.title || nameTestResult?.meta_info?.name }} - {{ nameTestResult?.meta_info?.season_episode }} - - - {{ nameTestResult?.media_info?.year || nameTestResult?.meta_info?.year }} - - - - - {{ nameTestResult?.media_info?.overview }} - - - - - - {{ - nameTestResult?.media_info?.type || nameTestResult?.meta_info?.type - }} - - - - {{ nameTestResult?.media_info?.category }} - - - - {{ nameTestResult?.media_info?.tmdb_id }} - - - - {{ nameTestResult?.meta_info?.edition }} - - - {{ nameTestResult?.meta_info?.resource_pix }} - - - {{ nameTestResult?.meta_info?.video_encode }} - - - {{ nameTestResult?.meta_info?.audio_encode }} - - - {{ nameTestResult?.meta_info?.resource_team }} - - -
-
- - 识别失败,无法识别到有效信息! - -
-
+
diff --git a/src/views/system/NameTestView.vue b/src/views/system/NameTestView.vue index 7d6ca0bf..6560179c 100644 --- a/src/views/system/NameTestView.vue +++ b/src/views/system/NameTestView.vue @@ -3,6 +3,7 @@ import { reactive, ref } from 'vue' import { requiredValidator } from '@/@validators' import api from '@/api' import type { Context } from '@/api/types' +import MediaInfoCard from '@/components/cards/MediaInfoCard.vue' // 识别结果 const nameTestResult = ref() @@ -45,22 +46,6 @@ async function nameTest() { console.error(error) } } - -// 打开TMDB详情页面 -function openTmdbPage(type: string, tmdbId: number) { - if (!type || !tmdbId) - return - - const url = `https://www.themoviedb.org/${type === '电影' ? 'movie' : 'tv'}/${tmdbId}` - window.open(url, '_blank') -} - -// TMDB图片转换为w500大小 -function getW500Image(url = '') { - if (!url) - return '' - return url.replace('original', 'w500') -}