1.9.6 misc bug fix
This commit is contained in:
parent
7c788a0efb
commit
5c334d7e3b
1 changed files with 20 additions and 15 deletions
35
js/app.js
35
js/app.js
|
@ -408,16 +408,21 @@ function playSong(el, songid, albumid) {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var title, artist, album;
|
var title, artist, album;
|
||||||
if (data["subsonic-response"].directory !== undefined) {
|
if (data["subsonic-response"].directory !== undefined) {
|
||||||
|
// There is a bug in the API that doesn't return a JSON array for one artist
|
||||||
|
var children = [];
|
||||||
if (data["subsonic-response"].directory.child.length > 0) {
|
if (data["subsonic-response"].directory.child.length > 0) {
|
||||||
$.each(data["subsonic-response"].directory.child, function (i, child) {
|
children = data["subsonic-response"].directory.child;
|
||||||
if (child.id === songid) {
|
} else {
|
||||||
title = child.title;
|
children[0] = data["subsonic-response"].directory.child;
|
||||||
artist = child.artist;
|
|
||||||
album = child.album;
|
|
||||||
coverart = child.coverArt;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
$.each(children, function (i, child) {
|
||||||
|
if (child.id === songid) {
|
||||||
|
title = child.title;
|
||||||
|
artist = child.artist;
|
||||||
|
album = child.album;
|
||||||
|
coverart = child.coverArt;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
$('#songdetails_song').html(title);
|
$('#songdetails_song').html(title);
|
||||||
$('#songdetails_song').attr('parentid', albumid);
|
$('#songdetails_song').attr('parentid', albumid);
|
||||||
|
@ -428,7 +433,7 @@ function playSong(el, songid, albumid) {
|
||||||
$('#playermiddle').css('visibility', 'visible');
|
$('#playermiddle').css('visibility', 'visible');
|
||||||
$('#songdetails').css('visibility', 'visible');
|
$('#songdetails').css('visibility', 'visible');
|
||||||
// SoundManager Initialize
|
// SoundManager Initialize
|
||||||
var salt = Math.floor(Math.random()*100000);
|
var salt = Math.floor(Math.random() * 100000);
|
||||||
if (audio) {
|
if (audio) {
|
||||||
soundManager.destroySound('audio');
|
soundManager.destroySound('audio');
|
||||||
}
|
}
|
||||||
|
@ -1125,16 +1130,16 @@ function updateMessage(msg) {
|
||||||
}
|
}
|
||||||
// Convert to unicode support
|
// Convert to unicode support
|
||||||
var toHTML = {
|
var toHTML = {
|
||||||
on: function(str) {
|
on: function (str) {
|
||||||
var a = [],
|
var a = [],
|
||||||
i = 0;
|
i = 0;
|
||||||
for (; i < str.length;) a[i] = str.charCodeAt(i++);
|
for (; i < str.length; ) a[i] = str.charCodeAt(i++);
|
||||||
return "&#" + a.join(";&#") + ";"
|
return "&#" + a.join(";&#") + ";"
|
||||||
},
|
},
|
||||||
un: function(str) {
|
un: function (str) {
|
||||||
return str.replace(/&#(x)?([^&]{1,5});?/g,
|
return str.replace(/&#(x)?([^&]{1,5});?/g,
|
||||||
function(a, b, c) {
|
function (a, b, c) {
|
||||||
return String.fromCharCode(parseInt(c, b ? 16 : 10))
|
return String.fromCharCode(parseInt(c, b ? 16 : 10))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue