diff --git a/ajax/ajax_listsongs.php b/ajax/ajax_listsongs.php index 7d4d70a..4203547 100644 --- a/ajax/ajax_listsongs.php +++ b/ajax/ajax_listsongs.php @@ -29,19 +29,17 @@ $sth->execute(); $data['volume'] = getSystemVolume(); system("HOME=" . WEBUSERHOMEDIR . " && ../scripts/homeaudio_togglemute.pl -show", $retval); $data['muted'] = ($retval == 0) ? false : true; -$data['songplaying'] = ""; +$data['currentsong'] = array("art"=>"", "title"=>"", "artist"=>"", "album"=>"", "year"=>""); $data['songlist'] = ""; $firstsong = true; while ( $row = $sth->fetch() ) { $song = new Song($row['songid']); if ( $firstsong ) { - $data['songplaying'] .= "
\n"; - $data['songplaying'] .= "
\n"; - $data['songplaying'] .= "

Title: {$song->getTitle(HTMLSAFE)}

\n"; - $data['songplaying'] .= "

Artist: {$song->getArtist(HTMLSAFE)}

\n"; - $data['songplaying'] .= "

Album: {$song->getAlbum(HTMLSAFE)}

\n"; - $data['songplaying'] .= "

Year: {$song->getYear(HTMLSAFE)}

\n"; - $data['songplaying'] .= "
\n"; + $data['currentsong']["art"] = $song->getArtFile(ARTURL); + $data['currentsong']["title"] = $song->getTitle(HTMLSAFE); + $data['currentsong']["artist"] = $song->getArtist(HTMLSAFE); + $data['currentsong']["album"] = $song->getAlbum(HTMLSAFE); + $data['currentsong']["year"] = $song->getYear(HTMLSAFE); $firstsong = false; } else { $data['songlist'] .= "
\n"; diff --git a/index.php b/index.php index 818c23d..f009b34 100755 --- a/index.php +++ b/index.php @@ -39,7 +39,15 @@ $queues = Queue::getList();
  • Lists
  • -
    +
    +
    +
    +

    Title:

    +

    Artist:

    +

    Albums:

    +

    Year:

    +
    +

    @@ -119,3 +127,4 @@ $queues = Queue::getList(); + diff --git a/js/minimal.js b/js/minimal.js index 2bae6f7..5f7d2d1 100755 --- a/js/minimal.js +++ b/js/minimal.js @@ -191,7 +191,11 @@ function getSongList() { $('#volume_slider').slider("value", data.volume); } $('#history_contents').html(data.songlist); - $('#playing_contents').html(data.songplaying); + $('#playing_img').attr("src", data.currentsong.art); + $('#playing_title').html(data.currentsong.title); + $('#playing_artist').html(data.currentsong.artist); + $('#playing_album').html(data.currentsong.album); + $('#playing_year').html(data.currentsong.year); updateChristmasButton(data.christmas); updateMuteButton(data.muted); $('#christmas_freq').val(data.christmasfreq); @@ -446,3 +450,5 @@ function getVolume () { } }); } + +// vim: set ts=3 sw=3 ai et: