From 40f3b7d83ea1d25886d540e767eedc4bf2e7be4b Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 12 Aug 2015 10:14:54 -0500 Subject: [PATCH] * correct part deduplicator --- ruby/lib/jam_ruby/jam_track_importer.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ruby/lib/jam_ruby/jam_track_importer.rb b/ruby/lib/jam_ruby/jam_track_importer.rb index 9fcafab35..f929a8545 100644 --- a/ruby/lib/jam_ruby/jam_track_importer.rb +++ b/ruby/lib/jam_ruby/jam_track_importer.rb @@ -779,9 +779,11 @@ module JamRuby tracks.each do |track| - found = unique_instruments[[track.instrument_id, track.part]] + key = "#{track.instrument_id} | #{track.part}" + found = unique_instruments[key] if !found found = [] + unique_instruments[key] = found end found << track @@ -797,13 +799,19 @@ module JamRuby else track.part = "#{track.part} #{count + 1}" end + count += 1 end - count += 1 end end + + # debug output + tracks.each do |track| + puts "TRACK #{track.instrument_id} #{track.part}" + end end + def sort_tracks(tracks) sorted_tracks = tracks.sort do |a, b|