about summary refs log tree commit homepage
path: root/bin/dtas-tl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-09-09 04:33:22 +0000
committerEric Wong <normalperson@yhbt.net>2013-09-09 04:36:06 +0000
commit6de01f03d5d9d248046853af45ed2eeef3b1308e (patch)
tree0767d169952b9efece01ddcbc8eabbf75b7efa1b /bin/dtas-tl
parentdf66dbd4594527ce5e6e8315c6775c9dbdd12dc1 (diff)
downloaddtas-6de01f03d5d9d248046853af45ed2eeef3b1308e.tar.gz
This adds a bunch of tracks sequentially to the end of the tracklist
Diffstat (limited to 'bin/dtas-tl')
-rwxr-xr-xbin/dtas-tl14
1 files changed, 13 insertions, 1 deletions
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 ])