#1473 Fix the listing of files

This commit is contained in:
Alain Nussbaumer 2023-03-24 04:17:17 +01:00
parent c6b4f565a5
commit 41d80c4f1a
2 changed files with 16 additions and 20 deletions

View File

@ -22,16 +22,16 @@
</div>
</template>
<template #content>
<list-directories :directories="files.directories" />
<list-playlists :playlists="playlists_list" />
<list-directories :directories="dirs" />
<list-playlists :playlists="playlists" />
<list-tracks
:tracks="files.tracks.items"
:tracks="tracks"
:expression="play_expression"
:show_icon="true"
/>
<modal-dialog-directory
:show="show_details_modal"
:directory="{ path: current_directory }"
:directory="current_directory"
@close="show_details_modal = false"
/>
</template>
@ -58,16 +58,15 @@ const dataObject = {
set: function (vm, response) {
if (response) {
vm.files = response.data
vm.playlists_list = new GroupByList(response.data.playlists)
vm.dirs = response.data.directories
vm.playlists = new GroupByList(response.data.playlists)
vm.tracks = new GroupByList(response.data.tracks)
} else {
vm.files = {
directories: vm.$store.state.config.directories.map((dir) => {
vm.dirs = vm.$store.state.config.directories.map((dir) => {
return { path: dir }
}),
tracks: { items: [] },
playlists: { items: [] }
}
})
vm.playlists = new GroupByList()
vm.tracks = new GroupByList()
}
}
}
@ -97,12 +96,9 @@ export default {
data() {
return {
files: {
directories: [],
tracks: { items: [] },
playlists: { items: [] }
},
playlists_list: new GroupByList(),
dirs: [],
playlists: new GroupByList(),
tracks: new GroupByList(),
show_details_modal: false
}
},

View File

@ -19,7 +19,7 @@
import ContentWithHeading from '@/templates/ContentWithHeading.vue'
import ListTracks from '@/components/ListTracks.vue'
import webapi from '@/webapi'
import { GroupByList } from '../lib/GroupByList'
import { GroupByList } from '@/lib/GroupByList'
const dataObject = {
load: function (to) {