diff options
author | Eric Wong <e@80x24.org> | 2015-12-15 01:07:28 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-12-15 01:08:30 +0000 |
commit | 90dcf561fd22c8a53c03d97292f86a82e74ca4a3 (patch) | |
tree | d390e915297016d0994d8ee8e326069bca35d262 /bin/dtas-tl | |
parent | 1a9d174f4aabbba37a32b6d4fea6bd8d2bc5b0ae (diff) | |
download | dtas-90dcf561fd22c8a53c03d97292f86a82e74ca4a3.tar.gz |
This partially reverts commit 0dde5917fb5135ee3601383c29ffc0490071ea9d. This fixes "addtail" on an empty tracklist and preserves sequential ordering of track IDs, which might make sense for usability.
Diffstat (limited to 'bin/dtas-tl')
-rwxr-xr-x | bin/dtas-tl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/dtas-tl b/bin/dtas-tl index 34fba81..30821a1 100755 --- a/bin/dtas-tl +++ b/bin/dtas-tl @@ -114,11 +114,13 @@ when "addtail" ARGV.shift track_ids = get_track_ids(c) last_id = track_ids.pop - ARGV.reverse_each do |path| + ARGV.each do |path| path = File.expand_path(path) - req = %W(tl add #{path} #{last_id}) + req = %W(tl add #{path}) + req << last_id.to_s if last_id res = c.req(req) print "#{path} #{res}\n" + last_id = res if res =~ /\A\d+\z/ end when "reto" fixed = ARGV.delete("-F") |