diff --git a/src/api/types.ts b/src/api/types.ts index b844d4fa..e3cec090 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -1051,7 +1051,7 @@ export interface TransferDirectoryConf { // 监控模式 fast/compatibility monitor_mode?: string // 整理方式 move/copy/link/softlink - transfer_type?: string + transfer_type: string // 文件覆盖模式 always/size/never/latest overwrite_mode?: string // 整理到媒体库目录 @@ -1139,3 +1139,42 @@ export interface SubscrbieInfo { // 集信息 {集号: {download: 文件路径,library: 文件路径, backdrop: url, title: 标题, description: 描述}} episodes: Record } + +export interface TransferForm { + // 文件项 + fileitem: FileItem + // 历史ID + logid: number + // 目标存储 + target_storage: string + // 目标路径 + target_path: string + // TMDB ID + tmdbid?: number + // 豆瓣 ID + doubanid?: string + // 季号 + season?: number + // 类型 + type_name?: string + // 整理方式 + transfer_type: string + // 自定义格式 + episode_format?: string + // 指定集数 + episode_detail?: string + // 指定PART + episode_part?: string + // 集数偏移 + episode_offset?: string + // 最小文件大小 + min_filesize: number + // 刮削 + scrape: boolean + // 复用历史识别信息 + from_history: boolean + // 媒体库类型子目录 + library_type_folder?: boolean + // 媒体库类别子目录 + library_category_folder?: boolean +} \ No newline at end of file diff --git a/src/components/dialog/ReorganizeDialog.vue b/src/components/dialog/ReorganizeDialog.vue index b7c2767e..87f5ecf7 100644 --- a/src/components/dialog/ReorganizeDialog.vue +++ b/src/components/dialog/ReorganizeDialog.vue @@ -6,7 +6,7 @@ import { storageOptions, transferTypeOptions } from '@/api/constants' import { numberValidator } from '@/@validators' import { useDisplay } from 'vuetify' import ProgressDialog from './ProgressDialog.vue' -import { FileItem, TransferDirectoryConf } from '@/api/types' +import { FileItem, TransferDirectoryConf, TransferForm } from '@/api/types' // 显示器宽度 const display = useDisplay() @@ -66,30 +66,19 @@ const dialogTitle = computed(() => { }) // 表单 -const transferForm = reactive({ - fileitem: {}, +const transferForm = reactive({ + fileitem: {} as FileItem, logid: 0, target_storage: props.target_storage ?? 'local', - target_path: props.target_path ?? null, - tmdbid: null, - doubanid: null, - season: null, - type_name: '', transfer_type: '', - episode_format: '', - episode_detail: '', - episode_part: '', - episode_offset: null, + target_path: '', min_filesize: 0, scrape: false, from_history: false, - library_type_folder: false, - library_category_folder: false, }) // 所有媒体库目录 const directories = ref([]) - // 查询目录 async function loadDirectories() { try { @@ -125,8 +114,10 @@ watch( transferForm.library_type_folder = false } } else { - // 路径为空时, 整理方式留空(自动) + // 路径为空时, 恢复到`自动`条件 transferForm.transfer_type = '' + transferForm.library_type_folder = undefined + transferForm.library_category_folder = undefined } } ) @@ -195,7 +186,7 @@ async function handleTransfer(item: FileItem) { // 整理日志 async function handleTransferLog(logid: number) { transferForm.logid = logid - transferForm.fileitem = {} + transferForm.fileitem = {} as FileItem try { const result: { [key: string]: any } = await api.post('transfer/manual', transferForm) if (!result.success) $toast.error(`历史记录 ${logid} 重新整理失败:${result.message}!`) @@ -350,7 +341,7 @@ onMounted(() => { - + { persistent-hint /> - +