[web] Fix display of playlists in files page

This commit is contained in:
chme 2022-06-15 19:53:17 +02:00
parent f167f3c2fc
commit daba58f05f
2 changed files with 7 additions and 2 deletions

View File

@ -148,7 +148,9 @@ export class GroupByList {
groupIndex
)
*/
if (groupIndex >= this.indexList.length) {
if (this.isEmpty()) {
return { done: true }
} else if (groupIndex >= this.indexList.length) {
// We reached the end of all groups and items
//
// This should never happen, as the we already

View File

@ -23,7 +23,7 @@
</template>
<template #content>
<list-directories :directories="files.directories" />
<list-playlists :playlists="files.playlists.items" />
<list-playlists :playlists="playlists_list" />
<list-tracks
:tracks="files.tracks.items"
:expression="play_expression"
@ -46,6 +46,7 @@ import ListPlaylists from '@/components/ListPlaylists.vue'
import ListTracks from '@/components/ListTracks.vue'
import ModalDialogDirectory from '@/components/ModalDialogDirectory.vue'
import webapi from '@/webapi'
import { GroupByList } from '@/lib/GroupByList'
const dataObject = {
load: function (to) {
@ -58,6 +59,7 @@ const dataObject = {
set: function (vm, response) {
if (response) {
vm.files = response.data
vm.playlists_list = new GroupByList(response.data.playlists)
} else {
vm.files = {
directories: vm.$store.state.config.directories.map((dir) => {
@ -100,6 +102,7 @@ export default {
tracks: { items: [] },
playlists: { items: [] }
},
playlists_list: new GroupByList(),
show_details_modal: false
}
},