From 459519080c929211f5cf2997c22d1155c7fd1383 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 14 Dec 2015 04:35:19 +0000 Subject: dtas-tl edit: fix ordering of newly-added songs We need to add new songs in reverse order of what's in the file to preserve ordering when they're added after an existing ID. This way we don't have to remember the track we just added, either. --- bin/dtas-tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dtas-tl b/bin/dtas-tl index fd5ced9..b682e2b 100755 --- a/bin/dtas-tl +++ b/bin/dtas-tl @@ -86,7 +86,7 @@ def do_edit(c) orig.each do |track_id| edit_idx[track_id] or c.req("tl remove #{track_id}") end - add.each do |path, after_id| + add.reverse_each do |path, after_id| cmd = %W(tl add #{path}) cmd << after_id.to_s if after_id c.req(cmd) -- cgit v1.2.3-24-ge0c7