Skip to content

Commit

Permalink
log and continue on error
Browse files Browse the repository at this point in the history
  • Loading branch information
privatezero committed Mar 29, 2022
1 parent c7c48e9 commit bc73d63
Showing 1 changed file with 33 additions and 23 deletions.
56 changes: 33 additions & 23 deletions audioqc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ class QcTarget
end

def output_csv_line(options)
line = [@input_path, @warnings.flatten.join(', '), @duration_normalized]
if options.include?('error')
line = [@input_path, 'FAILED TO PARSE']
else
line = [@input_path, @warnings.flatten.join(', '), @duration_normalized]
end
if options.include?('dropouts')
line << @possible_drops
end
Expand Down Expand Up @@ -344,32 +348,38 @@ else
end

file_inputs.each do |fileinput|
target = QcTarget.new(File.expand_path(fileinput))
target.get_mediainfo
if options.include?('meta')
if defined? POLICY_FILE
target.media_conch_scan(POLICY_FILE)
else
target.media_conch_scan('Valid Policy File Not Found')
begin
targetPath = File.expand_path(fileinput)
target = QcTarget.new(targetPath)
target.get_mediainfo
if options.include?('meta')
if defined? POLICY_FILE
target.media_conch_scan(POLICY_FILE)
else
target.media_conch_scan('Valid Policy File Not Found')
end
target.check_metaedit unless TARGET_EXTENSION != 'wav'
end
target.check_metaedit unless TARGET_EXTENSION != 'wav'
end
if options.include?('bext')
target.qc_encoding_history
end
if options.include?('md5')
target.check_md5
end
if options.include?('signal') || options.include?('dropouts')
target.get_ffprobe
if options.include?('signal')
target.find_peaks_loudness_n_phase
if options.include?('bext')
target.qc_encoding_history
end
if options.include?('dropouts')
target.check_dropouts
if options.include?('md5')
target.check_md5
end
if options.include?('signal') || options.include?('dropouts')
target.get_ffprobe
if options.include?('signal')
target.find_peaks_loudness_n_phase
end
if options.include?('dropouts')
target.check_dropouts
end
end
write_to_csv << target.output_csv_line(options)
rescue
puts "Error scanning: #{targetPath}"
write_to_csv << target.output_csv_line('error')
end
write_to_csv << target.output_csv_line(options)
end

CSV.open(output_csv, 'wb') do |csv|
Expand Down

0 comments on commit bc73d63

Please sign in to comment.