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