fix for sorting by genre
This commit is contained in:
parent
4780e5882f
commit
bfeae81b6d
1 changed files with 10 additions and 6 deletions
|
@ -83,7 +83,7 @@ const app = new Vue({
|
||||||
"albumName": "Album",
|
"albumName": "Album",
|
||||||
"artistName": "Artist",
|
"artistName": "Artist",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"genre": "Genre",
|
"genreNames": "Genre",
|
||||||
"releaseDate": "Release Date",
|
"releaseDate": "Release Date",
|
||||||
"durationInMillis": "Duration"
|
"durationInMillis": "Duration"
|
||||||
},
|
},
|
||||||
|
@ -359,12 +359,14 @@ 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
|
// 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
|
// 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) => {
|
self.library.songs.displayListing.sort((a, b) => {
|
||||||
|
let aa = null;
|
||||||
|
let bb = null;
|
||||||
if(self.library.songs.sorting == "genre") {
|
if(self.library.songs.sorting == "genre") {
|
||||||
aa = a.attributes.genreNames[0]
|
aa = a.attributes.genreNames[0]
|
||||||
bb = b.attributes.genreNames[0]
|
bb = b.attributes.genreNames[0]
|
||||||
}
|
}
|
||||||
let aa = a.attributes[self.library.songs.sorting]
|
aa = a.attributes[self.library.songs.sorting]
|
||||||
let bb = b.attributes[self.library.songs.sorting]
|
bb = b.attributes[self.library.songs.sorting]
|
||||||
if (aa == null) {
|
if (aa == null) {
|
||||||
aa = ""
|
aa = ""
|
||||||
}
|
}
|
||||||
|
@ -382,12 +384,14 @@ 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
|
// 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
|
// 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) => {
|
self.library.songs.displayListing.sort((a, b) => {
|
||||||
if(self.library.songs.sorting == "genre") {
|
let aa = null;
|
||||||
|
let bb = null;
|
||||||
|
if(self.library.songs.sorting == "genreNames") {
|
||||||
aa = a.attributes.genreNames[0]
|
aa = a.attributes.genreNames[0]
|
||||||
bb = b.attributes.genreNames[0]
|
bb = b.attributes.genreNames[0]
|
||||||
}
|
}
|
||||||
let aa = a.attributes[self.library.songs.sorting]
|
aa = a.attributes[self.library.songs.sorting]
|
||||||
let bb = b.attributes[self.library.songs.sorting]
|
bb = b.attributes[self.library.songs.sorting]
|
||||||
if (aa == null) {
|
if (aa == null) {
|
||||||
aa = ""
|
aa = ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue