diff --git a/web-src/src/components/ListPlaylists.vue b/web-src/src/components/ListPlaylists.vue index ccf7f3ad..b5b60003 100644 --- a/web-src/src/components/ListPlaylists.vue +++ b/web-src/src/components/ListPlaylists.vue @@ -1,23 +1,23 @@ @@ -16,6 +16,7 @@ import ContentWithHeading from '@/templates/ContentWithHeading.vue' import ListPlaylists from '@/components/ListPlaylists.vue' import webapi from '@/webapi' +import { GroupByList, noop } from '@/lib/GroupByList' const dataObject = { load: function (to) { @@ -27,7 +28,7 @@ const dataObject = { set: function (vm, response) { vm.playlist = response[0].data - vm.playlists = response[1].data + vm.playlists_list = new GroupByList(response[1].data) } } @@ -51,7 +52,25 @@ export default { data() { return { playlist: {}, - playlists: {} + playlists_list: new GroupByList() + } + }, + + computed: { + radio_playlists() { + return this.$store.state.config.radio_playlists + }, + + playlists() { + this.playlists_list.group(noop(), [ + (playlist) => + playlist.folder || + this.radio_playlists || + playlist.stream_count === 0 || + playlist.item_count > playlist.stream_count + ]) + + return this.playlists_list } } }