2020-06-30 09:53:54 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<content-with-heading>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #heading-left>
|
2022-05-20 13:44:22 +02:00
|
|
|
<p class="title is-4" v-text="$t('page.radio.title')" />
|
2020-06-30 09:53:54 +02:00
|
|
|
</template>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #content>
|
2022-05-29 18:49:00 +02:00
|
|
|
<p
|
|
|
|
class="heading has-text-centered-mobile"
|
|
|
|
v-text="$t('page.radio.count', { count: tracks.total })"
|
|
|
|
/>
|
2023-03-23 23:19:55 +01:00
|
|
|
<list-tracks :tracks="tracks" />
|
2020-06-30 09:53:54 +02:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-19 06:18:01 +01:00
|
|
|
import ContentWithHeading from '@/templates/ContentWithHeading.vue'
|
|
|
|
import ListTracks from '@/components/ListTracks.vue'
|
2020-06-30 09:53:54 +02:00
|
|
|
import webapi from '@/webapi'
|
2023-03-24 04:17:17 +01:00
|
|
|
import { GroupByList } from '@/lib/GroupByList'
|
2020-06-30 09:53:54 +02:00
|
|
|
|
2022-02-19 06:18:01 +01:00
|
|
|
const dataObject = {
|
2020-06-30 09:53:54 +02:00
|
|
|
load: function (to) {
|
|
|
|
return webapi.library_radio_streams()
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (vm, response) {
|
2023-03-23 23:19:55 +01:00
|
|
|
vm.tracks = new GroupByList(response.data.tracks)
|
2020-06-30 09:53:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PageRadioStreams',
|
2020-10-04 17:31:47 +02:00
|
|
|
components: { ContentWithHeading, ListTracks },
|
2020-06-30 09:53:54 +02:00
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
beforeRouteEnter(to, from, next) {
|
2022-02-19 06:18:01 +01:00
|
|
|
dataObject.load(to).then((response) => {
|
2022-02-19 06:39:14 +01:00
|
|
|
next((vm) => dataObject.set(vm, response))
|
2022-02-19 06:18:01 +01:00
|
|
|
})
|
|
|
|
},
|
2022-02-19 06:39:14 +01:00
|
|
|
beforeRouteUpdate(to, from, next) {
|
2022-02-19 06:18:01 +01:00
|
|
|
const vm = this
|
|
|
|
dataObject.load(to).then((response) => {
|
|
|
|
dataObject.set(vm, response)
|
|
|
|
next()
|
|
|
|
})
|
2022-02-19 06:39:14 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2023-03-23 23:19:55 +01:00
|
|
|
tracks: new GroupByList()
|
2022-02-19 06:39:14 +01:00
|
|
|
}
|
2020-06-30 09:53:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
<style></style>
|