Switch custom song list to json response
This commit is contained in:
parent
12debe134b
commit
20d7bc42f5
|
@ -9,20 +9,22 @@ $sth = $globaldbh->prepare($query);
|
|||
$sth->execute($fields);
|
||||
|
||||
$data = array();
|
||||
$firstsong = true;
|
||||
$data["customq"] = array();
|
||||
while ( $row = $sth->fetch() ) {
|
||||
$songid = $row['songid'];
|
||||
$song = new Song($songid);
|
||||
echo "<div id='customq_{$songid}' class='songlist_song_container' onClick='dropCustomQSong({$songid});'>\n";
|
||||
echo " <div class='songlist_img_container'><img class='songlist_img' src='{$song->getArtFile(ARTURL)}'></div>\n";
|
||||
echo " <div class='songlist_details_container'>\n";
|
||||
echo " <p class='nomargin'><span class='playing_label'>Song:</span> {$song->getTitle(HTMLSAFE)}</p>\n";
|
||||
echo " <p class='nomargin'><span class='playing_label'>Artist:</span> {$song->getArtist(HTMLSAFE)}</p>\n";
|
||||
echo " <p class='nomargin'><span class='playing_label'>Album:</span> {$song->getAlbum(HTMLSAFE)}</p>\n";
|
||||
echo " </div>\n";
|
||||
echo "</div>\n";
|
||||
echo "<hr class='songlist'>\n";
|
||||
$curdata = array();
|
||||
$curdata["id"] = $song->getID();
|
||||
$curdata["arturl"] = $song->getArtFile(ARTURL);
|
||||
$curdata["title"] = $song->getTitle(HTMLSAFE);
|
||||
$curdata["artist"] = $song->getArtist(HTMLSAFE);
|
||||
$curdata["album"] = $song->getAlbum(HTMLSAFE);
|
||||
$curdata["year"] = $song->getYear(HTMLSAFE);
|
||||
$data['customq'][] = $curdata;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data);
|
||||
exit();
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ var gettingSongList = false;
|
|||
var gettingJukeboxList = false;
|
||||
var searchTimeout = null;
|
||||
var queueTarget = 0;
|
||||
var paused = true;
|
||||
var paused = false;
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#tabs').tabs({
|
||||
|
@ -262,9 +262,9 @@ function getJukeboxList() {
|
|||
function getCustomQueueList() {
|
||||
$.ajax({
|
||||
url: 'ajax/ajax_getcustomq.php',
|
||||
dataType: 'html',
|
||||
dataType: 'json',
|
||||
success: function(data, stat, jqo) {
|
||||
$('#customq_contents').html(data);
|
||||
$('#customq_contents').html(generateSongListHTML("customq", data.customq));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user