diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cea9dbfc..aefec4d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,13 @@ jobs: yarn build zip -r dist.zip dist + - name: Delete Release + uses: dev-drprasad/delete-tag-and-release@v1.0 + with: + tag_name: ${{ env.frontend_version }} + github_token: ${{ secrets.GITHUB_TOKEN }} + delete_release: true + - name: Generate Release uses: softprops/action-gh-release@v1 with: diff --git a/src/components/filebrowser/List.vue b/src/components/filebrowser/List.vue index 261e4485..5b447bbf 100644 --- a/src/components/filebrowser/List.vue +++ b/src/components/filebrowser/List.vue @@ -6,7 +6,7 @@ import axios from 'axios' import { useToast } from 'vue-toast-notification' import { numberValidator } from '@/@validators' import { formatBytes } from '@core/utils/formatters' -import type { EndPoints, FileItem } from '@/api/types' +import type { Context, EndPoints, FileItem } from '@/api/types' import store from '@/store' import api from '@/api' @@ -84,6 +84,9 @@ const transferForm = reactive({ }) +// 识别结果 +const nameTestResult = ref() + // 生成1到50季的下拉框选项 const seasonItems = ref( Array.from({ length: 51 }, (_, i) => i).map(item => ({ @@ -273,6 +276,7 @@ watch( () => inProps.path, async () => { items.value = [] + nameTestResult.value = undefined await load() }, ) @@ -311,6 +315,34 @@ function stopLoadingProgress() { progressEventSource.value?.close() } +// 调用API识别 +async function recognize(path: string) { + try { + // 显示进度条 + progressDialog.value = true + progressText.value = `正在识别 ${path} ...` + nameTestResult.value = await api.get('media/recognize_file', { + params: { + path, + }, + }) + // 关闭进度条 + progressDialog.value = false + if (!nameTestResult.value) + $toast.error(`${path} 识别失败!`) + } + catch (error) { + console.error(error) + } +} + +// TMDB图片转换为w500大小 +function getW500Image(url = '') { + if (!url) + return '' + return url.replace('original', 'w500') +} + // 弹出菜单 const dropdownItems = ref([ { @@ -365,9 +397,118 @@ onMounted(() => { - 文件: {{ path }}
+ 文件: {{ path }} + +
+
+ + + +
+ +
+ + + {{ 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 }} + + +
+
{ class="me-2" /> - - mdi-download - - - mdi-refresh - + + + mdi-text-recognition + + + + + mdi-download + + + + + mdi-refresh + +