diff options
-rw-r--r-- | lib/dtas/player/client_handler.rb | 4 | ||||
-rw-r--r-- | lib/dtas/tracklist.rb | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb index 2966193..7a63df1 100644 --- a/lib/dtas/player/client_handler.rb +++ b/lib/dtas/player/client_handler.rb @@ -527,7 +527,7 @@ module DTAS::Player::ClientHandler # :nodoc: return io.emit("ERR tl add PATH [after_track_id] [true|false]") end begin - @tl.add_track(path, after_track_id, set_as_current) + track_id = @tl.add_track(path, after_track_id, set_as_current) rescue ArgumentError => e return io.emit("ERR #{e.message}") end @@ -537,7 +537,7 @@ module DTAS::Player::ClientHandler # :nodoc: if @tl.size == 1 && !(@current || @queue[0] || @paused) next_source(path) end - io.emit("OK") + io.emit("#{track_id}") when "repeat" case msg.shift when "true" then @tl.repeat = true diff --git a/lib/dtas/tracklist.rb b/lib/dtas/tracklist.rb index 2c4ad03..2336545 100644 --- a/lib/dtas/tracklist.rb +++ b/lib/dtas/tracklist.rb @@ -87,6 +87,7 @@ class DTAS::Tracklist @list.unshift(track) @pos = 0 if set_as_current end + track.object_id end def remove_track(track_id) |