diff --git a/src/api/constants.ts b/src/api/constants.ts index 7149a66e..af81f191 100644 --- a/src/api/constants.ts +++ b/src/api/constants.ts @@ -3,26 +3,31 @@ export const storageOptions = [ title: '本地', value: 'local', icon: 'mdi-folder-multiple-outline', + remote: false, }, { title: '阿里云盘', value: 'alipan', icon: 'mdi-cloud-outline', + remote: true, }, { title: '115网盘', value: 'u115', icon: 'mdi-cloud-outline', + remote: true, }, { title: 'RClone', value: 'rclone', icon: 'mdi-cloud-outline', + remote: true, }, { title: 'AList', value: 'alist', icon: 'mdi-cloud-outline', + remote: true, }, ] diff --git a/src/components/cards/DirectoryCard.vue b/src/components/cards/DirectoryCard.vue index 8e451540..35cc5a1e 100644 --- a/src/components/cards/DirectoryCard.vue +++ b/src/components/cards/DirectoryCard.vue @@ -29,6 +29,11 @@ const typeItems = [ { title: '电视剧', value: '电视剧' }, ] +// 计算资源存储字典(整理方式为下载器时不能为远程存储) +const resourceStorageOptions = computed(() => { + return storageOptions.filter(item => !item.remote || props.directory.monitor_type !== 'downloader') +}) + // 自动整理方式下拉字典 const transferSourceItems = [ { title: '不整理', value: '' }, @@ -131,7 +136,7 @@ const getCategories = computed(() => { return default_value.concat(props.categories[props.directory.media_type ?? '']) }) -// 监听 下载储存与媒体库储存 变化,重新加载整理方式下拉字典 +// 监听 资源存储与媒体库储存 变化,重新加载整理方式下拉字典 watch( [() => props.directory.library_storage, () => props.directory.storage], ([newLibraryStorage, newStorage], [oldLibraryStorage, oldStorage]) => { @@ -156,6 +161,16 @@ watch( } }, ) + +// 监听monitor_type变化,如果为downloader则设置为本地 +watch( + () => props.directory.monitor_type, + newMonitorType => { + if (newMonitorType === 'downloader') { + props.directory.storage = 'local' + } + }, +)