summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-15 19:20:20 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-15 19:20:20 -0700
commitad06926dd3ab2285479ecde0148ba6910dffbb56 (patch)
tree06b1ae2d249abf7ae8b891426cfd903f67419778
parent0e42e37a43a0a573c79946b7c918f2b8e5fe0339 (diff)
downloadomptagger-ad06926dd3ab2285479ecde0148ba6910dffbb56.tar.gz
omptagger-ad06926dd3ab2285479ecde0148ba6910dffbb56.tar.xz
Ability to view MP3 tags.
-rwxr-xr-xomptagger31
1 files changed, 14 insertions, 17 deletions
diff --git a/omptagger b/omptagger
index b6dc1c1..d6d221e 100755
--- a/omptagger
+++ b/omptagger
@@ -89,21 +89,6 @@ class Metadata
puts 'No tags set.'.format(:info)
throw :next
end
- end
-
- def viewtag(tag)
- puts ('Viewing ' + tag + ' tag:').format(:action)
-
- unless @tags.has_key? tag
- puts 'Tag not set.'.format(:info)
- throw :next
- end
- end
-end
-
-class VorbisComment < Metadata
- def view
- super
@tags.sort.each do |tag, val|
val.each do |val|
@@ -113,14 +98,22 @@ class VorbisComment < Metadata
end
def viewtag(tag)
- super
+ puts ('Viewing ' + tag + ' tag:').format(:action)
+
+ unless @tags.has_key? tag
+ puts 'Tag not set.'.format(:info)
+ throw :next
+ end
@tags[tag].each do |val|
- output(tag, val)
+ output(tag, val.to_s)
end
end
end
+class VorbisComment < Metadata
+end
+
class FLAC < VorbisComment
def initialize(file)
super
@@ -146,6 +139,10 @@ class MP3 < Metadata
@file = TagLib::MPEG::File.new(file)
@tags = @file.ID3v2Tag.frameListMap.hash
end
+
+ def output(tag, val, padding = 0)
+ super(tag, val.to_s, padding)
+ end
end
def help