summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2007-09-11 17:57:44 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-05 22:01:22 -0700
commit587a3bb0d02321a336d07bc5c7ea51330f844529 (patch)
treeeea48b8e2d7d4df61af387f6db57382aa74aa488
parent939b63d3c365325a4e3e24002aa3d45e012e66a6 (diff)
downloadomptagger-587a3bb0d02321a336d07bc5c7ea51330f844529.tar.gz
omptagger-587a3bb0d02321a336d07bc5c7ea51330f844529.tar.xz
Import version 0.6.2 into git history.
-rwxr-xr-xomptagger27
1 files changed, 10 insertions, 17 deletions
diff --git a/omptagger b/omptagger
index 6b8288c..51b80d6 100755
--- a/omptagger
+++ b/omptagger
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
#
-# omptagger [version 0.6.1]
+# omptagger [version 0.6.2]
# http://dev.gentoo.org/~omp/omptagger/
#
# Copyright 2007 David Shakaryan <omp@gentoo.org>
@@ -319,14 +319,10 @@ class VorbisComments
raise 'Missing TITLE tag.'
end
- # Determine what the new filename should be.
- ext = file.split('.').last.downcase
- file = File.dirname(@file) + '/'
- if @tags.has_key?('TRACKNUMBER')
- file = file + @tags['TRACKNUMBER'] + ' - '
- end
- file = file + @tags['ARTIST'] + ' - ' +
- @tags['TITLE'] + '.' + ext
+ # Determine the new filename.
+ file = @tags['ARTIST'].first + ' - ' + @tags['TITLE'].first +
+ '.' + @file.split('.').last.downcase
+ file = File.dirname(@file) + '/' + file.gsub('/', '_')
# Raise an error if the new and old filenames are identical.
if File.basename(@file) == File.basename(file)
@@ -527,14 +523,11 @@ class ID3
raise 'Missing TITLE tag.'
end
- # Determine what the new filename should be.
- ext = file.split('.').last.downcase
- file = File.dirname(@file) + '/'
- unless @tags.frame_text(TAGS['TRACK']).nil?
- file = file + @tags.frame_text(TAGS['TRACK']) + ' - '
- end
- file = file + @tags.frame_text(TAGS['ARTIST']) + ' - ' +
- @tags.frame_text(TAGS['TITLE']) + '.' + ext
+ # Determine the new filename.
+ file = @tags.frame_text(TAGS['ARTIST']) + ' - ' +
+ @tags.frame_text(TAGS['TITLE']) +
+ '.' + @file.split('.').last.downcase
+ file = File.dirname(@file) + '/' + file.gsub('/', '_')
# Raise an error if the new and old filenames are identical.
if File.basename(@file) == File.basename(file)