* fix bug with one track and count-in

This commit is contained in:
Seth Call 2015-12-24 21:23:52 -06:00
parent a23703fb09
commit 2ad519fc90
3 changed files with 7 additions and 2 deletions

View File

@ -5,6 +5,8 @@ ActiveAdmin.register JamRuby::JamTrack, :as => 'JamTracks' do
config.sort_order = 'name_asc'
config.batch_actions = false
filter :name
filter :original_artist
filter :genres
filter :status, :as => :select, collection: JamRuby::JamTrack::STATUS

View File

@ -1031,7 +1031,7 @@ module JamRuby
precount_num = precount.to_i
end
elsif comparable_filename.include?("master mix") || comparable_filename.include?("mastered mix") || (@metadata[:id] && comparable_filename.start_with?(@metadata[:id].downcase))
elsif comparable_filename.include?("master mix") || comparable_filename.include?("mastered mix") || (@metadata && (@metadata[:id] && comparable_filename.start_with?(@metadata[:id].downcase)))
master = true
type = :master
else

View File

@ -534,8 +534,11 @@ module JamRuby
speed = @settings['speed'] || 0
real_count = @track_settings.count
real_count -= 1 if @include_count_in
# if there is only one track to mix, we need to skip mixing (sox will barf if you try to mix one file), but still divide by number of tracks
if @track_settings.count == 1
if real_count <= 1
mix_divide = 1.0/@track_count
cmd = "sox -v #{mix_divide} \"#{@track_settings[0][:volumed_file]}\" \"#{@mix_file}\""
cmd(cmd, 'volume_adjust')