mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 08:06:43 +08:00
fix
This commit is contained in:
@@ -38,8 +38,13 @@ const downloadDirectories = ref<MediaDirectory[]>([])
|
|||||||
|
|
||||||
// 计算公共路径
|
// 计算公共路径
|
||||||
function findCommonPath(paths: string[]): string {
|
function findCommonPath(paths: string[]): string {
|
||||||
if (!paths || paths.length === 0) return ''
|
if (!paths || paths.length === 0) return '/'
|
||||||
if (paths.length === 1) return paths[0]
|
if (paths.length === 1) {
|
||||||
|
if (!paths[0].endsWith('/')) {
|
||||||
|
return paths[0] + '/'
|
||||||
|
}
|
||||||
|
return paths[0]
|
||||||
|
}
|
||||||
const normalizedPaths = paths.map(path => path.replace(/\\/g, '/'))
|
const normalizedPaths = paths.map(path => path.replace(/\\/g, '/'))
|
||||||
const splitPaths = normalizedPaths.map(path => path.split('/'))
|
const splitPaths = normalizedPaths.map(path => path.split('/'))
|
||||||
let commonParts: string[] = []
|
let commonParts: string[] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user