class Elasticmusic::Song
Public Instance Methods
Private Instance Methods
audio_properties(fileref)
click to toggle source
# File lib/elasticmusic/song.rb, line 35 def audio_properties(fileref) { bitrate: fileref.audio_properties.bitrate, channels: fileref.audio_properties.channels, length: fileref.audio_properties.length, sample_rate: fileref.audio_properties.sample_rate } end
validate_file()
click to toggle source
# File lib/elasticmusic/song.rb, line 44 def validate_file if File.exists?(path.to_s) if !Elasticmusic::SUPPORTED_FORMATS.include?(File.extname(path)) errors.add(:path, "The format #{File.extname(path).downcase} is not suported") end else errors.add(:path, 'The specified path is not valid') end end