From 072002c68451a5e7e62046a72ddac1d4bae7fcea Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Wed, 11 Jan 2023 15:51:08 +0100 Subject: [PATCH] no negative remaining time --- components/Control.vue | 9 +++++---- package-lock.json | 4 ++-- package.json | 2 +- stores/playlist.ts | 1 - 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/Control.vue b/components/Control.vue index 8ea3abe0..43dca5dc 100644 --- a/components/Control.vue +++ b/components/Control.vue @@ -26,12 +26,12 @@
- {{ playlistStore.timeStr }} + {{ timeStr }}
- {{ secToHMS(playlistStore.remainingSec) }} + {{ secToHMS((playlistStore.remainingSec >= 0) ? playlistStore.remainingSec : 0) }}
@@ -147,6 +147,7 @@ const contentType = { 'content-type': 'application/json;charset=UTF-8' } const isPlaying = ref('') const breakStatusCheck = ref(false) +const timeStr = ref('00:00:00') const timer = ref() const streamExtension = ref(configStore.configGui[configStore.configID].preview_url.split('.').pop()) const httpStream = ref() @@ -222,8 +223,8 @@ async function status() { /* recursive function as a endless loop */ - playlistStore.timeStr = $dayjs().utcOffset(configStore.utcOffset).format('HH:mm:ss') - const timeInSec = timeToSeconds(playlistStore.timeStr) + timeStr.value = $dayjs().utcOffset(configStore.utcOffset).format('HH:mm:ss') + const timeInSec = timeToSeconds(timeStr.value) playlistStore.remainingSec = playlistStore.currentClipStart + playlistStore.currentClipOut - timeInSec const playedSec = playlistStore.currentClipOut - playlistStore.remainingSec playlistStore.progressValue = (playedSec * 100) / playlistStore.currentClipOut diff --git a/package-lock.json b/package-lock.json index 9632054f..27c5e468 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ffplayout-frontend", - "version": "0.1.1", + "version": "0.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ffplayout-frontend", - "version": "0.1.1", + "version": "0.1.3", "hasInstallScript": true, "dependencies": { "@nuxt/types": "^2.15.8", diff --git a/package.json b/package.json index ba639749..0f343beb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ffplayout-frontend", - "version": "0.1.2", + "version": "0.1.3", "description": "Web GUI for ffplayout", "author": "Jonathan Baecker", "private": true, diff --git a/stores/playlist.ts b/stores/playlist.ts index 9f40c611..1f6b14d6 100644 --- a/stores/playlist.ts +++ b/stores/playlist.ts @@ -25,7 +25,6 @@ export const usePlaylist = defineStore('playlist', { currentClipDuration: 0, currentClipIn: 0, currentClipOut: 0, - timeStr: '00:00:00', remainingSec: 0, playoutIsRunning: true, }),