mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 06:33:21 -05:00
[web-src] Only show quality informations if they are available
This commit is contained in:
parent
9616cfdf0c
commit
b15b5c88fa
@ -53,7 +53,12 @@
|
||||
</p>
|
||||
<p>
|
||||
<span class="heading">Quality</span>
|
||||
<span class="title is-6">{{ item.type}} | {{ item.samplerate }} Hz | {{ item.channels }} | {{ item.bitrate }} Kb/s</span>
|
||||
<span class="title is-6">
|
||||
{{ item.type }}
|
||||
<span v-if="item.samplerate"> | {{ item.samplerate }} Hz</span>
|
||||
<span v-if="item.channels"> | {{ item.channels | channels }}</span>
|
||||
<span v-if="item.bitrate"> | {{ item.bitrate }} Kb/s</span>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -59,7 +59,12 @@
|
||||
</p>
|
||||
<p>
|
||||
<span class="heading">Quality</span>
|
||||
<span class="title is-6">{{ track.type}} | {{ track.samplerate}} Hz | {{ track.channels }} channels | {{ track.bitrate}} Kb/s</span>
|
||||
<span class="title is-6">
|
||||
{{ track.type }}
|
||||
<span v-if="track.samplerate"> | {{ track.samplerate }} Hz</span>
|
||||
<span v-if="track.channels"> | {{ track.channels | channels }}</span>
|
||||
<span v-if="track.bitrate"> | {{ track.bitrate }} Kb/s</span>
|
||||
</span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="heading">Added at</span>
|
||||
|
@ -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'
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user