forked from platypush/platypush
Prevent js errors upon null artist or album
This commit is contained in:
parent
699fa92c5e
commit
9e28379203
1 changed files with 12 additions and 0 deletions
|
@ -445,6 +445,18 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
files = files.sort(function(a, b) {
|
files = files.sort(function(a, b) {
|
||||||
|
if ((a.artist && !b.artist) || (a.album && !b.album)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!a.artist && b.artist) || (!a.album && b.album)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((a.artist && b.artist) || (a.album && b.album)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (a.artist === b.artist) {
|
if (a.artist === b.artist) {
|
||||||
if (a.album === b.album) {
|
if (a.album === b.album) {
|
||||||
return parseInt(a.track) < parseInt(b.track) ? -1 : 1;
|
return parseInt(a.track) < parseInt(b.track) ? -1 : 1;
|
||||||
|
|
Loading…
Reference in a new issue