mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
fix 历史记录路径
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moviepilot",
|
"name": "moviepilot",
|
||||||
"version": "1.5.1",
|
"version": "1.5.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"bin": "dist/service.js",
|
"bin": "dist/service.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -107,4 +107,4 @@
|
|||||||
"resolutions": {
|
"resolutions": {
|
||||||
"postcss": "8"
|
"postcss": "8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -214,6 +214,21 @@ async function removeHistoryBatch() {
|
|||||||
deleteConfirmDialog.value = true
|
deleteConfirmDialog.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 计算根路径
|
||||||
|
function getRootPath(path: string, type: string, category: string) {
|
||||||
|
if (!path)
|
||||||
|
return ''
|
||||||
|
let index = -2
|
||||||
|
if (type !== '电影')
|
||||||
|
index = -3
|
||||||
|
if (category)
|
||||||
|
index -= 1
|
||||||
|
if (path.includes('/'))
|
||||||
|
return path.split('/').slice(0, index).join('/')
|
||||||
|
else
|
||||||
|
return path.split('\\').slice(0, index).join('\\')
|
||||||
|
}
|
||||||
|
|
||||||
// 批量重新整理
|
// 批量重新整理
|
||||||
async function retransferBatch() {
|
async function retransferBatch() {
|
||||||
if (selected.value.length === 0)
|
if (selected.value.length === 0)
|
||||||
@@ -227,22 +242,11 @@ async function retransferBatch() {
|
|||||||
// 目的目录
|
// 目的目录
|
||||||
const dest = selected.value[0].dest ?? ''
|
const dest = selected.value[0].dest ?? ''
|
||||||
// 类型
|
// 类型
|
||||||
const mediaType = selected.value[0].type
|
const mediaType = selected.value[0].type ?? ''
|
||||||
// 分类
|
// 分类
|
||||||
const category = selected.value[0].category
|
const category = selected.value[0].category ?? ''
|
||||||
if (dest) {
|
// 计算根路径
|
||||||
let index = -2
|
redoTarget.value = getRootPath(dest, mediaType, category)
|
||||||
if (mediaType !== '电影')
|
|
||||||
index = -3
|
|
||||||
|
|
||||||
if (category)
|
|
||||||
index -= 1
|
|
||||||
// 截取路径
|
|
||||||
redoTarget.value = dest.split('/').slice(0, index).join('/')
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
redoTarget.value = ''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
redoTarget.value = ''
|
redoTarget.value = ''
|
||||||
@@ -260,19 +264,7 @@ const dropdownItems = ref([
|
|||||||
prependIcon: 'mdi-redo-variant',
|
prependIcon: 'mdi-redo-variant',
|
||||||
click: (item: TransferHistory) => {
|
click: (item: TransferHistory) => {
|
||||||
redoIds.value = [item.id]
|
redoIds.value = [item.id]
|
||||||
if (item.dest) {
|
redoTarget.value = getRootPath(item.dest ?? '', item.type ?? '', item.category ?? '')
|
||||||
let index = -2
|
|
||||||
if (item.type !== '电影')
|
|
||||||
index = -3
|
|
||||||
|
|
||||||
if (item.category)
|
|
||||||
index -= 1
|
|
||||||
|
|
||||||
redoTarget.value = item.dest.split('/').slice(0, index).join('/')
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
redoTarget.value = ''
|
|
||||||
}
|
|
||||||
redoDialog.value = true
|
redoDialog.value = true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user