From f6247f66bfa8f8752d76cbde27f7421a22242d49 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Sun, 6 Aug 2023 23:27:10 +0200 Subject: [PATCH] correct preview path, fix #104 --- pages/player.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pages/player.vue b/pages/player.vue index 1029d853..321ff290 100644 --- a/pages/player.vue +++ b/pages/player.vue @@ -714,9 +714,16 @@ function moveItemInArray(event: any) { function setPreviewData(path: string) { let fullPath = path + const storagePath = configStore.configPlayout.storage.path + const lastIndex = storagePath.lastIndexOf('/') + if (!path.includes('/')) { const parent = mediaStore.folderTree.parent ? mediaStore.folderTree.parent : '' 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]