From d131bb0964ba323eac225c888a84875c1ae8cd3d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 8 Oct 2013 03:04:41 +0000 Subject: player: "tl add" may trigger player start The player should start playing the new track if the current tracklist is exhausted and not paused. --- lib/dtas/player/client_handler.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3-24-ge0c7