summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-18 23:00:19 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-18 23:00:19 -0700
commit05f4f07b2fdc52395bed6505f14ade137812e821 (patch)
tree1eb47ac91b60891326bbc49fedfd13451251758f
parent0d2a65126180faa8dda2398553438ecc925c17c3 (diff)
downloadomptagger-05f4f07b2fdc52395bed6505f14ade137812e821.tar.gz
omptagger-05f4f07b2fdc52395bed6505f14ade137812e821.tar.xz
Use a class variable for FileMagic.
-rwxr-xr-xomptagger8
1 files changed, 4 insertions, 4 deletions
diff --git a/omptagger b/omptagger
index 59c4f12..e5e4ad3 100755
--- a/omptagger
+++ b/omptagger
@@ -112,6 +112,9 @@ Tag Generation:
end
class Datum
+ @@mime = FileMagic.mime
+ @@mime.simplified = true
+
def initialize(filename)
raise 'File does not exist.' unless File.exist?(filename)
@@ -119,10 +122,7 @@ class Datum
@filename = File.expand_path(filename)
- mime = FileMagic.mime
- mime.simplified = true
-
- case mime.file(@filename)
+ case @@mime.file(@filename)
when 'audio/x-flac'
type = FLAC
when 'application/ogg'