Skip to content
Snippets Groups Projects
Commit 8b8711fc authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: allow duration of playlist entries to be reset to undefined

undefined duration has special handling in the playout so this should be
supported.
parent a53a48dd
No related branches found
No related tags found
No related merge requests found
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
:value="typeof duration === 'number' ? secondsToDurationString(duration) : ''" :value="typeof duration === 'number' ? secondsToDurationString(duration) : ''"
class="md:tw-max-w-[200px]" class="md:tw-max-w-[200px]"
:placeholder="t('file.durationPlaceholder')" :placeholder="t('file.durationPlaceholder')"
@blur="duration = parseTime(($event.target as HTMLInputElement).value)" @blur="setDuration"
@keydown.enter="duration = parseTime(($event.target as HTMLInputElement).value)" @keydown.enter="setDuration"
/> />
</FormGroup> </FormGroup>
</FormTable> </FormTable>
...@@ -189,6 +189,13 @@ const artistInfo = computed(() => { ...@@ -189,6 +189,13 @@ const artistInfo = computed(() => {
} }
}) })
function setDuration(event: Event) {
const value = (event.target as HTMLInputElement).value
// A duration of zero should be treated as undefined so that the
// default playout behaviour for non-fixed-lengths entries can take over.
duration.value = parseTime(value) || undefined
}
async function save() { async function save() {
if (duration.value !== entry.value.duration) { if (duration.value !== entry.value.duration) {
entry.value = { ...entry.value, duration: duration.value } entry.value = { ...entry.value, duration: duration.value }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment