about summary refs log tree commit homepage
path: root/bin
diff options
authorEric Wong <normalperson@yhbt.net>2013-09-09 04:12:29 +0000
committerEric Wong <normalperson@yhbt.net>2013-09-09 04:13:16 +0000
commit59ca3ba986e1f872d851b9b6ce588e20d8020243 (patch)
tree36b26be54ce81055471c48b5f4e1a80152e5f9d6 /bin
parent4b29f098adfaa900dc7c293163eb914f6725d800 (diff)
This should allow us to repeat through a list of tracks with relative
ease.  There is a rudimentary dtas-tl client implemented.  This
may be removed in the future.
Diffstat (limited to 'bin')
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/dtas-tl b/bin/dtas-tl
new file mode 100755
index 0000000..cbe1b83
--- /dev/null
+++ b/bin/dtas-tl
@@ -0,0 +1,25 @@
+#!/usr/bin/env ruby
+# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
+# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
+require 'dtas/unix_client'
+require 'yaml'
+require 'shellwords'
+c = DTAS::UNIXClient.new
+case cmd = ARGV[0]
+when "cat"
+  track_ids = c.req("tl tracks")
+  # we could get more, but SEQPACKET limits size...
+  track_ids.split(/ /).each do |track_id|
+    puts c.req("tl get #{track_id}")
+  end
+when "add-all"
+  ARGV.shift
+  ARGV.reverse.each do |path|
+    res = c.req_ok("tl add #{path}")
+    puts "#{path} #{res}"
+  end
+  # act like dtas-ctl for now...
+  puts c.req([ "tl", *ARGV ])