correct storage path, fix ffplayout:#746

This commit is contained in:
jb-alvarado 2024-09-12 20:49:25 +02:00
parent f9d5c31eb3
commit 2e4587bd6a
3 changed files with 17 additions and 11 deletions

View File

@ -347,7 +347,7 @@ function addFolderToTemplate(event: any, item: TemplateItem) {
event.item.remove()
const storagePath = configStore.playout.storage.path
const storagePath = configStore.channels[configStore.id].storage_path
const navPath = mediaStore.folderCrumbs[mediaStore.folderCrumbs.length - 1].path
const sourcePath = `${storagePath}/${navPath}/${mediaStore.folderList.folders[o].name}`.replace(/\/[/]+/g, '/')

View File

@ -78,7 +78,7 @@
'!bg-lime-500/30':
playlistStore.playoutIsRunning && listDate === todayDate && index === currentIndex,
'!bg-amber-600/40': element.overtime,
'text-base-content/60': element.category === 'advertisement'
'text-base-content/50': element.category === 'advertisement'
}"
>
<td v-if="!configStore.playout.playlist.infinit" class="ps-4 py-2 text-left">
@ -253,7 +253,7 @@ function addClip(event: any) {
event.item?.remove()
const storagePath = configStore.playout.storage.path
const storagePath = configStore.channels[configStore.id].storage_path
const sourcePath = `${storagePath}/${mediaStore.folderTree.source}/${mediaStore.folderTree.files[o].name}`.replace(
/\/[/]+/g,
'/'

View File

@ -170,7 +170,12 @@
<div class="label">
<span class="label-text">{{ t('player.file') }}</span>
</div>
<input v-model="newSource.source" type="text" class="input input-sm input-bordered w-auto" />
<input
v-model="newSource.source"
type="text"
class="input input-sm input-bordered w-auto"
:disabled="newSource.source.includes(configStore.channels[configStore.id].storage_path)"
/>
</label>
<label class="form-control w-auto mt-auto">
@ -309,7 +314,7 @@ function closePlayer() {
function setPreviewData(path: string) {
let fullPath = path
const storagePath = configStore.playout.storage.path
const storagePath = configStore.channels[configStore.id].storage_path
const lastIndex = storagePath.lastIndexOf('/')
if (!path.includes('/')) {
@ -325,9 +330,10 @@ function setPreviewData(path: string) {
if (path.match(/^http/)) {
previewUrl.value = path
} else {
previewUrl.value = encodeURIComponent(
`/file/${configStore.channels[configStore.id].id}${fullPath}`
).replace(/%2F/g, '/')
previewUrl.value = encodeURIComponent(`/file/${configStore.channels[configStore.id].id}${fullPath}`).replace(
/%2F/g,
'/'
)
}
const ext = previewName.value.split('.').slice(-1)[0].toLowerCase()
@ -456,9 +462,9 @@ async function importPlaylist(imp: boolean) {
playlistStore.isLoading = true
await $fetch(
`/api/file/${configStore.channels[configStore.id].id}/import/?file=${
textFile.value[0].name
}&date=${listDate.value}`,
`/api/file/${configStore.channels[configStore.id].id}/import/?file=${textFile.value[0].name}&date=${
listDate.value
}`,
{
method: 'PUT',
headers: authStore.authHeader,