mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
Optimize song filterings
This commit is contained in:
parent
06303c4852
commit
5f9cb7a796
1 changed files with 5 additions and 1 deletions
|
@ -72,6 +72,7 @@ export default {
|
|||
sortingByAlbum: false,
|
||||
sortingByArtist: false,
|
||||
selectedSongs: [],
|
||||
mutatedItems: [],
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -84,6 +85,8 @@ export default {
|
|||
this.sortKey = '';
|
||||
}
|
||||
|
||||
this.mutatedItems = this.items;
|
||||
|
||||
// Update the song count and duration status on parent.
|
||||
this.$parent.updateMeta({
|
||||
songCount: this.items.length,
|
||||
|
@ -100,7 +103,7 @@ export default {
|
|||
displayedItems() {
|
||||
return limitBy(
|
||||
filterBy(
|
||||
orderBy(this.items, this.sortKey, this.order),
|
||||
this.mutatedItems,
|
||||
this.q,
|
||||
'title', 'album.name', 'artist.name'
|
||||
),
|
||||
|
@ -124,6 +127,7 @@ export default {
|
|||
this.order = 0 - this.order;
|
||||
this.sortingByAlbum = Array.isArray(this.sortKey) && this.sortKey[0] === 'album.name';
|
||||
this.sortingByArtist = Array.isArray(this.sortKey) && this.sortKey[0] === 'album.artist.name';
|
||||
this.mutatedItems = orderBy(this.items, this.sortKey, this.order);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue