From 97eab8e8de0370e956aff1e0a6852ab85e614856 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Mon, 19 Feb 2018 20:14:14 +0100 Subject: [PATCH] Avoid display quircks of duration --- front/src/store/player.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/front/src/store/player.js b/front/src/store/player.js index fb348042f..df8d159f4 100644 --- a/front/src/store/player.js +++ b/front/src/store/player.js @@ -50,7 +50,12 @@ export default { }, getters: { durationFormatted: state => { - return time.parse(Math.round(state.duration)) + let duration = parseInt(state.duration) + if (duration % 1 !== 0) { + return time.parse(0) + } + duration = Math.round(state.duration) + return time.parse(duration) }, currentTimeFormatted: state => { return time.parse(Math.round(state.currentTime))