correct preview path, fix #104
This commit is contained in:
parent
599dc76058
commit
f6247f66bf
@ -714,9 +714,16 @@ function moveItemInArray(event: any) {
|
|||||||
|
|
||||||
function setPreviewData(path: string) {
|
function setPreviewData(path: string) {
|
||||||
let fullPath = path
|
let fullPath = path
|
||||||
|
const storagePath = configStore.configPlayout.storage.path
|
||||||
|
const lastIndex = storagePath.lastIndexOf('/')
|
||||||
|
|
||||||
if (!path.includes('/')) {
|
if (!path.includes('/')) {
|
||||||
const parent = mediaStore.folderTree.parent ? mediaStore.folderTree.parent : ''
|
const parent = mediaStore.folderTree.parent ? mediaStore.folderTree.parent : ''
|
||||||
fullPath = `/${parent}/${mediaStore.folderTree.source}/${path}`.replace(/\/[/]+/g, '/')
|
fullPath = `/${parent}/${mediaStore.folderTree.source}/${path}`.replace(/\/[/]+/g, '/')
|
||||||
|
} else if (lastIndex !== -1) {
|
||||||
|
let pathPrefix = storagePath.substring(0, lastIndex)
|
||||||
|
|
||||||
|
fullPath = path.replace(pathPrefix, '')
|
||||||
}
|
}
|
||||||
|
|
||||||
previewName.value = fullPath.split('/').slice(-1)[0]
|
previewName.value = fullPath.split('/').slice(-1)[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user