From b15b5c88faf4b75e799d7f5ea8eb6100c148e5f1 Mon Sep 17 00:00:00 2001 From: chme Date: Tue, 30 Jun 2020 09:31:50 +0200 Subject: [PATCH] [web-src] Only show quality informations if they are available --- web-src/src/components/ModalDialogQueueItem.vue | 7 ++++++- web-src/src/components/ModalDialogTrack.vue | 7 ++++++- web-src/src/filter/index.js | 13 +++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/web-src/src/components/ModalDialogQueueItem.vue b/web-src/src/components/ModalDialogQueueItem.vue index 93cd2163..0f29b0b7 100644 --- a/web-src/src/components/ModalDialogQueueItem.vue +++ b/web-src/src/components/ModalDialogQueueItem.vue @@ -53,7 +53,12 @@

Quality - {{ item.type}} | {{ item.samplerate }} Hz | {{ item.channels }} | {{ item.bitrate }} Kb/s + + {{ item.type }} + | {{ item.samplerate }} Hz + | {{ item.channels | channels }} + | {{ item.bitrate }} Kb/s +

diff --git a/web-src/src/components/ModalDialogTrack.vue b/web-src/src/components/ModalDialogTrack.vue index 333a0e7d..24f9032a 100644 --- a/web-src/src/components/ModalDialogTrack.vue +++ b/web-src/src/components/ModalDialogTrack.vue @@ -59,7 +59,12 @@

Quality - {{ track.type}} | {{ track.samplerate}} Hz | {{ track.channels }} channels | {{ track.bitrate}} Kb/s + + {{ track.type }} + | {{ track.samplerate }} Hz + | {{ track.channels | channels }} + | {{ track.bitrate }} Kb/s +

Added at diff --git a/web-src/src/filter/index.js b/web-src/src/filter/index.js index 24e875ce..9de4f364 100644 --- a/web-src/src/filter/index.js +++ b/web-src/src/filter/index.js @@ -24,3 +24,16 @@ Vue.filter('timeFromNow', function (value, withoutSuffix) { Vue.filter('number', function (value) { return value.toLocaleString() }) + +Vue.filter('channels', function (value) { + if (value === 1) { + return 'mono' + } + if (value === 2) { + return 'stereo' + } + if (!value) { + return '' + } + return value + ' channels' +})