Загрузка плейлистов.
[mpd-web.git] / ajax / trackinfo.php
index e5cc464fbcca3dc978b942c4ae43deb4edfefaa6..f1c4b362b8fbc2ed04d86a617d56a0b6ace778fd 100644 (file)
@@ -2,16 +2,25 @@
 
 include('mpd.php');
 
 
 include('mpd.php');
 
-$cur_track= $mpd->current_track_id;
-$playlist= $mpd->playlist;
-if($cur_track !=-1)
+$cur_track = $mpd->current_track_id;
+$playlist = $mpd->playlist;
 
 
+$playlist_count = $mpd->playlist_count;
+
+if($cur_track !=-1) {
+
+    $trackno=$cur_track+1;
+
+    echo "<div class=\"trackno\">#$trackno/$playlist_count</div>";
     if ($playlist[$cur_track]['name']==$playlist[$cur_track]['title']) {
     if ($playlist[$cur_track]['name']==$playlist[$cur_track]['title']) {
-        echo htmlentities(cut_file($playlist[$cur_track]['name']));
+        echo "<div class=\"trackname\">".htmlentities(cut_file($playlist[$cur_track]['name']))."</div>";
     } else {
     } else {
-        echo htmlentities($playlist[$cur_track]['title']);
+        echo "<div class=\"trackname\">".htmlentities($playlist[$cur_track]['title'])."</div>";
     }
     }
-else 
-    echo "No Track selected";
+    
+} else {
+    echo "<div class=\"trackno\">#-/$playlist_count</div>";
+    echo "<div class=\"trackname\">Трек не выбран</div>";
+}
 
 ?>
 
 ?>