seek not allowed without song in queue
authorAndrew Karpow <andy@ndyk.de>
Fri, 17 Jan 2014 15:41:54 +0000 (16:41 +0100)
committerAndrew Karpow <andy@ndyk.de>
Fri, 17 Jan 2014 15:41:54 +0000 (16:41 +0100)
htdocs/js/mpd.js

index d40c96b..a742e46 100644 (file)
@@ -55,7 +55,7 @@ $(document).ready(function(){
     });
     $('#progressbar').slider(0);
     $("#progressbar").on('slider.newValue', function(evt,data){
-        if(current_song) {
+        if(current_song && current_song.currentSongId >= 0) {
             var seekVal = Math.ceil(current_song.totalTime*(data.val/100));
             socket.send("MPD_API_SET_SEEK,"+current_song.currentSongId+","+seekVal);
         }