about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rwxr-xr-xbin/dtas-tl13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/dtas-tl b/bin/dtas-tl
index 4d9b6fe..7333a06 100755
--- a/bin/dtas-tl
+++ b/bin/dtas-tl
@@ -142,11 +142,14 @@ c = DTAS::UNIXClient.new
 case cmd = ARGV[0]
 when "cat"
   enc = Encoding.default_external
-  get_track_ids(c).each do |track_id|
-    res = c.req("tl get #{track_id}")
-    res.sub!(/\A1 /n, '')
-    fix_enc!(res, enc)
-    print "#{res}\n"
+  get_track_ids(c).each_slice(128) do |track_ids|
+    res = c.req("tl get #{track_ids.join(' ')}")
+    res = Shellwords.split(res.sub!(/\A\d+ /, ''))
+    while line = res.shift
+      line.sub!(/\A(\d+)=/n, '') or abort "unexpected line=#{line.inspect}\n"
+      fix_enc!(line, enc)
+      print "#{line}\n"
+    end
   end
 when 'aac' # add-after-current
   ARGV.shift