From 6de01f03d5d9d248046853af45ed2eeef3b1308e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 9 Sep 2013 04:33:22 +0000 Subject: dtas-tl: add add-tail command This adds a bunch of tracks sequentially to the end of the tracklist --- bin/dtas-tl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bin/dtas-tl') diff --git a/bin/dtas-tl b/bin/dtas-tl index cbe1b83..31a6825 100755 --- a/bin/dtas-tl +++ b/bin/dtas-tl @@ -16,9 +16,21 @@ when "cat" when "add-all" ARGV.shift ARGV.reverse.each do |path| - res = c.req_ok("tl add #{path}") + res = c.req(%W(tl add #{path})) puts "#{path} #{res}" end +when "add-tail" + ARGV.shift + track_ids = c.req("tl tracks") + track_ids = track_ids.split(/ /) + last_id = track_ids.pop + ARGV.each do |path| + req = %W(tl add #{path}) + req << last_id.to_s if last_id + res = c.req(req) + puts "#{path} #{res}" + last_id = res if res =~ /\A\d+\z/ + end else # act like dtas-ctl for now... puts c.req([ "tl", *ARGV ]) -- cgit v1.2.3-24-ge0c7