@@ -19,9 +19,12 @@ if Gem::Platform.local.os == 'mingw32'
1919 System = 'windows'
2020elsif Gem ::Platform . local . os == 'linux'
2121 System = 'linux'
22- else
23- #needs to be updated with actual check for mac!
22+ elsif
23+ Gem :: Platform . local . os == 'darwin'
2424 System = 'mac'
25+ else
26+ puts "Operating system has not been correctly detected. Linux will be assumed - errors may occur!"
27+ System = 'linux'
2528end
2629
2730
7376# set up arrays and variables
7477TARGET_EXTENSION = Configurations [ 'default_extension' ] unless defined? TARGET_EXTENSION
7578
79+ # set up output CSV path
80+ timestamp = Time . now . strftime ( '%Y-%m-%d_%H-%M-%S' )
81+ if Configurations [ 'csv_output_path' ] . empty?
82+ output_csv = ENV [ 'HOME' ] + "/Desktop/audioqc-out_#{ timestamp } .csv"
83+ else
84+ output_csv = Configurations [ 'csv_output_path' ] + "/audioqc-out_#{ timestamp } .csv"
85+ end
86+ if ! Dir . exist? ( File . dirname ( output_csv ) )
87+ puts "Output directory not found. Please configure a valid output directory"
88+ exit 1
89+ end
90+
7691# Start embedded WAV Mediaconch policy section
7792# Policy derived from MediaConch Public Policies. Original Maintainer Peter B. License: CC-BY-4.0+
7893mc_policy = <<~EOS
@@ -357,9 +372,6 @@ file_inputs.each do |fileinput|
357372 write_to_csv << target . output_csv_line ( options )
358373end
359374
360- timestamp = Time . now . strftime ( '%Y-%m-%d_%H-%M-%S' )
361- output_csv = ENV [ 'HOME' ] + "/Desktop/audioqc-out_#{ timestamp } .csv"
362-
363375CSV . open ( output_csv , 'wb' ) do |csv |
364376 headers = [ 'Filename' , 'Warnings' , 'Duration' ]
365377 if options . include? ( 'dropouts' )
0 commit comments