Module: UnitF::Tag::Helpers

Included in:
FileSet
Defined in:
lib/unitf/tag/helpers.rb

Instance Method Summary collapse

Instance Method Details

#valid_file?(file_path) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
# File 'lib/unitf/tag/helpers.rb', line 6

def valid_file?(file_path)
  ::File.file?(file_path) && file_path.encode.match(/\.(flac|mp3)$/i)
rescue ArgumentError => e
  UnitF::Log.error("Error processing #{file_path} - #{e.message}")
  false
end