From 4df44a365ae10e062bade92cbb85b4177b687f9b Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Sun, 5 May 2024 21:46:22 +0200 Subject: [PATCH] make title optional --- components/PlaylistTable.vue | 1 - composables/helper.ts | 4 ++++ pages/player.vue | 2 +- stores/playlist.ts | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/PlaylistTable.vue b/components/PlaylistTable.vue index 02d3cb04..2e16cea3 100644 --- a/components/PlaylistTable.vue +++ b/components/PlaylistTable.vue @@ -252,7 +252,6 @@ function addClip(event: any) { playlistStore.playlist.splice(n, 0, { uid, begin: 0, - title: mediaStore.folderTree.files[o].name, source: sourcePath, in: 0, out: mediaStore.folderTree.files[o].duration, diff --git a/composables/helper.ts b/composables/helper.ts index 4e39a57a..01ecb481 100644 --- a/composables/helper.ts +++ b/composables/helper.ts @@ -214,6 +214,10 @@ export const playlistOperations = () => { delete item.custom_filter } + if (!item.title) { + delete item.title + } + if ( begin + (item.out - item.in) > configStore.playout.playlist.startInSec + configStore.playout.playlist.lengthInSec diff --git a/pages/player.vue b/pages/player.vue index 5b6cd89b..0434f64b 100644 --- a/pages/player.vue +++ b/pages/player.vue @@ -246,7 +246,7 @@ const isVideo = ref(false) const newSource = ref({ begin: 0, - title: '', + title: null, in: 0, out: 0, duration: 0, diff --git a/stores/playlist.ts b/stores/playlist.ts index 3a126806..556a9a3a 100644 --- a/stores/playlist.ts +++ b/stores/playlist.ts @@ -17,7 +17,7 @@ export const usePlaylist = defineStore('playlist', { progressValue: 0, currentClip: '', currentClipIndex: 0, - currentClipTitle: '', + currentClipTitle: null as null | string, currentClipStart: 0, currentClipDuration: 0, currentClipIn: 0, @@ -82,7 +82,7 @@ export const usePlaylist = defineStore('playlist', { this.currentClipIn = item.media.in this.currentClipOut = item.media.out this.currentClipDuration = item.media.duration - this.currentClipTitle = item.media.title ?? '' + this.currentClipTitle = item.media.title ?? null this.currentClipIndex = item.index this.elapsedSec = item.elapsed this.ingestRuns = item.ingest