about summary refs log tree commit homepage
path: root/lib/dtas/player/client_handler.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-10-08 03:04:41 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-08 03:05:21 +0000
commitd131bb0964ba323eac225c888a84875c1ae8cd3d (patch)
treee80325243be17b996eb9aefa16a1a7bf302f857e /lib/dtas/player/client_handler.rb
parent10b6447a38c4f82951ff137335895c9067f36bc6 (diff)
downloaddtas-d131bb0964ba323eac225c888a84875c1ae8cd3d.tar.gz
The player should start playing the new track if the current tracklist
is exhausted and not paused.
Diffstat (limited to 'lib/dtas/player/client_handler.rb')
-rw-r--r--lib/dtas/player/client_handler.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb
index ea0fc28..f313a2a 100644
--- a/lib/dtas/player/client_handler.rb
+++ b/lib/dtas/player/client_handler.rb
@@ -554,12 +554,11 @@ module DTAS::Player::ClientHandler # :nodoc:
       rescue ArgumentError => e
         return io.emit("ERR #{e.message}")
       end
-      _tl_skip if set_as_current
 
-      # start playing if we're the only track
-      if @tl.size == 1 && ! need_to_queue
-        next_source(_next)
-      end
+      _tl_skip if set_as_current # if @current is playing, it will restart soon
+
+      # start playing if we're currently idle
+      next_source(_next) unless need_to_queue
       io.emit("#{track_id}")
     when "repeat"
       case msg.shift