summaryrefslogtreecommitdiff
path: root/omptagger
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-11-07 15:26:51 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-11-07 15:26:51 -0800
commit84f0130910fd9e1bf5584f502c000a8b7044b487 (patch)
treea76dabeb02b376b215d9631bda8abdb076700439 /omptagger
parentaed4cd0a167b4d48d8bf3e5a8de1b8d5b4614f51 (diff)
downloadomptagger-84f0130910fd9e1bf5584f502c000a8b7044b487.tar.gz
omptagger-84f0130910fd9e1bf5584f502c000a8b7044b487.tar.xz
Use extensions; filemagic doesn't always work.
Diffstat (limited to 'omptagger')
-rwxr-xr-xomptagger15
1 files changed, 5 insertions, 10 deletions
diff --git a/omptagger b/omptagger
index 83c055a..722f66c 100755
--- a/omptagger
+++ b/omptagger
@@ -12,13 +12,11 @@
# Ruby http://www.ruby-lang.org/
# RubyGems http://rubygems.org/
# rtaglib http://rubygems.org/gems/rtaglib
-# ruby-filemagic http://rubygems.org/gems/ruby-filemagic
# TagLib http://developer.kde.org/~wheeler/taglib.html
require 'getoptlong'
require 'rubygems'
require 'TagLib'
-require 'filemagic'
module Output
@@colour = true
@@ -90,9 +88,6 @@ See the man page for:
end
class Datum
- @@mime = FileMagic.mime
- @@mime.simplified = true
-
def initialize(filename)
raise 'File does not exist.' unless File.exist?(filename)
@@ -100,15 +95,15 @@ class Datum
@filename = File.expand_path(filename)
- case @@mime.file(@filename)
- when 'audio/x-flac'
+ case File.extname(filename)
+ when '.flac'
type = FLAC
- when 'application/ogg'
+ when '.ogg'
type = Vorbis
- when 'audio/mpeg'
+ when '.mp3'
type = MP3
else
- raise 'File type not recognised.'
+ raise 'File extension not recognised.'
end
@metadata = type.new(@filename)