songs sorting
This commit is contained in:
parent
507fa0af89
commit
4780e5882f
2 changed files with 34 additions and 9 deletions
|
@ -128,7 +128,7 @@ const app = new Vue({
|
|||
},
|
||||
page: "artist-page",
|
||||
pageHistory: [],
|
||||
songstest: true
|
||||
songstest: false
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
|
@ -359,6 +359,10 @@ const app = new Vue({
|
|||
// sort this.library.songs.displayListing by song.attributes[self.library.songs.sorting] in ascending order based on alphabetical order and numeric order
|
||||
// check if song.attributes[self.library.songs.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case
|
||||
self.library.songs.displayListing.sort((a, b) => {
|
||||
if(self.library.songs.sorting == "genre") {
|
||||
aa = a.attributes.genreNames[0]
|
||||
bb = b.attributes.genreNames[0]
|
||||
}
|
||||
let aa = a.attributes[self.library.songs.sorting]
|
||||
let bb = b.attributes[self.library.songs.sorting]
|
||||
if (aa == null) {
|
||||
|
@ -378,6 +382,10 @@ const app = new Vue({
|
|||
// sort this.library.songs.displayListing by song.attributes[self.library.songs.sorting] in descending order based on alphabetical order and numeric order
|
||||
// check if song.attributes[self.library.songs.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case
|
||||
self.library.songs.displayListing.sort((a, b) => {
|
||||
if(self.library.songs.sorting == "genre") {
|
||||
aa = a.attributes.genreNames[0]
|
||||
bb = b.attributes.genreNames[0]
|
||||
}
|
||||
let aa = a.attributes[self.library.songs.sorting]
|
||||
let bb = b.attributes[self.library.songs.sorting]
|
||||
if (aa == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue