 
         updateVisible: (@visibleSongs) ->
                 @playbackFiles = []
+                @_removeRandom()
                 @trigger "updateVisible", @visibleSongs
 
         length: =>


        table = playlistElement.dataTable tableProperties

        hashChange = (songName) ->
                if (not player.isPlaying()) and (not songName?)
                        queue.next()

                @nextSong = song
                return song

        _removeRandom: =>
                # Replace current random song with the first queued song.
                if @nextSong != null and @nextLength == 0
                        @nextSong = null
                        @peek()

        add: (song) =>
                @queuedSongs.push song
                @_removeRandom()
                @trigger "add", song
                return @queuedSongs.length

