mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 08:46:40 +08:00
fix: recommended
This commit is contained in:
@@ -66,16 +66,10 @@ const prefixOptions = computed(() => {
|
|||||||
function getStorageType(path: string) {
|
function getStorageType(path: string) {
|
||||||
if (!path) return 'local'
|
if (!path) return 'local'
|
||||||
// 查找匹配的存储类型
|
// 查找匹配的存储类型
|
||||||
for (const storage of storageAttributes) {
|
const storage = storageAttributes.find(
|
||||||
// skip checking local storage as it is the default
|
s => s.type !== 'local' && path.startsWith(`${s.type}:`)
|
||||||
if (storage.type === 'local') {
|
)
|
||||||
continue
|
return storage?.type || 'local'
|
||||||
}
|
|
||||||
if (path.startsWith(storage.type + ':')) {
|
|
||||||
return storage.type
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 'local'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function storage2Prefix(storage: string) {
|
function storage2Prefix(storage: string) {
|
||||||
@@ -105,7 +99,7 @@ function updateStorageSuffix(index: number, suffix: string) {
|
|||||||
if (!downloaderInfo.value.path_mapping) return
|
if (!downloaderInfo.value.path_mapping) return
|
||||||
const currentMapping = downloaderInfo.value.path_mapping[index]
|
const currentMapping = downloaderInfo.value.path_mapping[index]
|
||||||
const currentPath = currentMapping[0] || ''
|
const currentPath = currentMapping[0] || ''
|
||||||
let [currentPrefix] = parseStoragePath(currentPath)
|
const [currentPrefix] = parseStoragePath(currentPath)
|
||||||
currentMapping[0] = currentPrefix + suffix
|
currentMapping[0] = currentPrefix + suffix
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -489,7 +483,7 @@ onUnmounted(() => {
|
|||||||
<VLabel class="mb-2">{{ t('downloader.pathMapping') }}</VLabel>
|
<VLabel class="mb-2">{{ t('downloader.pathMapping') }}</VLabel>
|
||||||
<VRow
|
<VRow
|
||||||
v-for="(mapping, index) in downloaderInfo.path_mapping"
|
v-for="(mapping, index) in downloaderInfo.path_mapping"
|
||||||
:key="index"
|
:key="mapping[0] + '-' + mapping[1]"
|
||||||
class="align-start flex-wrap pm-row"
|
class="align-start flex-wrap pm-row"
|
||||||
>
|
>
|
||||||
<VCol cols="12" md="6" class="pl-0 pr-0">
|
<VCol cols="12" md="6" class="pl-0 pr-0">
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user