about summary refs log tree commit homepage
path: root/lib/dtas/player
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dtas/player')
-rw-r--r--lib/dtas/player/client_handler.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb
index 500704a..119aa31 100644
--- a/lib/dtas/player/client_handler.rb
+++ b/lib/dtas/player/client_handler.rb
@@ -566,6 +566,7 @@ module DTAS::Player::ClientHandler # :nodoc:
       end
       begin
         track_id = @tl.add_track(path, after_track_id, set_as_current)
+        return io.emit('ERR FULL') unless track_id
       rescue ArgumentError => e
         return io.emit("ERR #{e.message}")
       end
@@ -593,6 +594,13 @@ module DTAS::Player::ClientHandler # :nodoc:
         set_bool(io, 'tl shuffle', v) { |b| @tl.shuffle = b }
         io.emit('OK')
       end
+    when 'max'
+      case v = msg.shift
+      when nil then io.emit("tl max #{@tl.max}")
+      when %r{\A(\d[\d_]*)\z} then io.emit("tl max #{@tl.max = $1.to_i}")
+      else
+        return io.emit('ERR tl max must a non-negative integer')
+      end
     when "remove"
       track_id = msg.shift or return io.emit("ERR track_id not specified")
       track_id = track_id.to_i