[web] Return the list itself when group operation is done
This commit is contained in:
parent
d246c42a99
commit
8a303f340b
|
@ -101,6 +101,7 @@ export class GroupedList {
|
|||
}, new Map())
|
||||
// Create index list
|
||||
this.indices = Array.from(this.itemsGrouped.keys())
|
||||
return this
|
||||
}
|
||||
|
||||
*generate() {
|
||||
|
|
|
@ -151,16 +151,14 @@ export default {
|
|||
|
||||
computed: {
|
||||
albums() {
|
||||
const grouping = this.groupings.find(
|
||||
const { options } = this.groupings.find(
|
||||
(grouping) => grouping.id === this.selected_grouping_id
|
||||
)
|
||||
grouping.options.filters = [
|
||||
options.filters = [
|
||||
(album) => !this.hide_singles || album.track_count > 2,
|
||||
(album) => !this.hide_spotify || album.data_kind !== 'spotify'
|
||||
]
|
||||
this.albums_list.group(grouping.options)
|
||||
|
||||
return this.albums_list
|
||||
return this.albums_list.group(options)
|
||||
},
|
||||
hide_singles: {
|
||||
get() {
|
||||
|
|
|
@ -130,14 +130,13 @@ export default {
|
|||
|
||||
computed: {
|
||||
albums() {
|
||||
const grouping = this.groupings.find(
|
||||
const { options } = this.groupings.find(
|
||||
(grouping) => grouping.id === this.selected_grouping_id
|
||||
)
|
||||
grouping.options.filters = [
|
||||
options.filters = [
|
||||
(album) => !this.hide_spotify || album.data_kind !== 'spotify'
|
||||
]
|
||||
this.albums_list.group(grouping.options)
|
||||
return this.albums_list
|
||||
return this.albums_list.group(options)
|
||||
},
|
||||
hide_spotify: {
|
||||
get() {
|
||||
|
|
|
@ -165,14 +165,13 @@ export default {
|
|||
return this.tracks_list.items.map((item) => item.uri).join()
|
||||
},
|
||||
tracks() {
|
||||
const grouping = this.groupings.find(
|
||||
const { options } = this.groupings.find(
|
||||
(grouping) => grouping.id === this.selected_grouping_id
|
||||
)
|
||||
grouping.options.filters = [
|
||||
options.filters = [
|
||||
(track) => !this.hide_spotify || track.data_kind !== 'spotify'
|
||||
]
|
||||
this.tracks_list.group(grouping.options)
|
||||
return this.tracks_list
|
||||
return this.tracks_list.group(options)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -122,19 +122,15 @@ export default {
|
|||
computed: {
|
||||
// Wraps GroupedList and updates it if filter or sort changes
|
||||
artists() {
|
||||
if (!this.artists_list) {
|
||||
return []
|
||||
}
|
||||
const grouping = this.groupings.find(
|
||||
const { options } = this.groupings.find(
|
||||
(grouping) => grouping.id === this.selected_grouping_id
|
||||
)
|
||||
grouping.options.filters = [
|
||||
options.filters = [
|
||||
(artist) =>
|
||||
!this.hide_singles || artist.track_count > artist.album_count * 2,
|
||||
(artist) => !this.hide_spotify || artist.data_kind !== 'spotify'
|
||||
]
|
||||
this.artists_list.group(grouping.options)
|
||||
return this.artists_list
|
||||
return this.artists_list.group(options)
|
||||
},
|
||||
hide_singles: {
|
||||
get() {
|
||||
|
|
|
@ -135,11 +135,10 @@ export default {
|
|||
}
|
||||
},
|
||||
tracks() {
|
||||
const grouping = this.groupings.find(
|
||||
const { options } = this.groupings.find(
|
||||
(grouping) => grouping.id === this.selected_grouping_id
|
||||
)
|
||||
this.tracks_list.group(grouping.options)
|
||||
return this.tracks_list
|
||||
return this.tracks_list.group(options)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -131,11 +131,10 @@ export default {
|
|||
}
|
||||
},
|
||||
tracks() {
|
||||
const grouping = this.groupings.find(
|
||||
const { options } = this.groupings.find(
|
||||
(grouping) => grouping.id === this.selected_grouping_id
|
||||
)
|
||||
this.tracks_list.group(grouping.options)
|
||||
return this.tracks_list
|
||||
return this.tracks_list.group(options)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ export default {
|
|||
|
||||
computed: {
|
||||
playlists() {
|
||||
this.playlists_list.group({
|
||||
return this.playlists_list.group({
|
||||
filters: [
|
||||
(playlist) =>
|
||||
playlist.folder ||
|
||||
|
@ -75,7 +75,6 @@ export default {
|
|||
playlist.item_count > playlist.stream_count
|
||||
]
|
||||
})
|
||||
return this.playlists_list
|
||||
},
|
||||
radio_playlists() {
|
||||
return this.$store.state.config.radio_playlists
|
||||
|
|
Loading…
Reference in New Issue