--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mp3togo (0.5.11) unstable; urgency=low
+
+ * Fixed ommited year and tracknumber tags on mp3 conversions using eyeD3.
+ Reported by Konstantin Pastbin.
+
+ -- Simeon Veldstra <reallifesim@gmail.com> Sat, 09 Jun 2007 20:31:05 -0700
+
mp3togo (0.5.10) unstable; urgency=low
* Made quiet mode really quiet. Fixed -m option.
--- a/debian/mp3togo.1
+++ b/debian/mp3togo.1
@@ -134,4 +134,4 @@ License can be found in /usr/share/commo
.PP
mp3togo can be found online at http://puddle.ca/mp3togo
-.\" created by instant / docbook-to-man, Thu 15 Feb 2007, 17:18
+.\" created by instant / docbook-to-man, Sat 09 Jun 2007, 20:36
--- a/mp3togo/tags.py
+++ b/mp3togo/tags.py
@@ -103,6 +103,10 @@ class Tags(UserDict.DictMixin):
self._tags['ARTIST'] = [eye.getArtist() or '']
self._tags['ALBUM'] = [eye.getAlbum() or '']
self._tags['TITLE'] = [eye.getTitle() or '']
+ if eye.getYear() and eye.getYear() > 1600 and eye.getYear() < 3000:
+ self._tags['DATE'] = [eye.getYear()]
+ if eye.getTrackNum():
+ self._tags['TRACKNUMBER'] = [str(eye.getTrackNum()[0])]
try:
self._tags['GENRE'] = [getattr(eye.getGenre(), 'name', 'Other')]
except eyeD3.tag.GenreException:
@@ -163,7 +167,10 @@ class Tags(UserDict.DictMixin):
elif self._tags[key][0] in map(str, range(256)):
d[key] = int(self._tags[key][0])
else:
- d[key] = int(genres.get(self._tags[key][0], '255'))
+ try:
+ d[key] = int(genres.get(self._tags[key][0], '255'))
+ except:
+ d[key] = 12
else:
d[key] = self._tags[key][0]
# No! don't unlock here dumbass! return from puttags
@@ -197,6 +204,16 @@ class Tags(UserDict.DictMixin):
out.setTitle(d['TITLE'])
g = eyeD3.Genre()
g.setId(d.get('GENRE', 12))
+ try:
+ if d.has_key('DATE') and int(d['DATE']) > 1600 and int(d['DATE']) < 3000:
+ out.setDate(d['DATE'])
+ except:
+ pass
+ if d.has_key('TRACKNUMBER') and d['TRACKNUMBER']:
+ try:
+ out.setTrackNum((int(d['TRACKNUMBER']), None))
+ except:
+ pass
out.setGenre(g)
if d.has_key('COMMENT'):
out.addComment(d['COMMENT'])
--- a/mp3togo/track.py
+++ b/mp3togo/track.py
@@ -223,7 +223,13 @@ class Track:
# tag files from the cache as well, brwarning may have changed
if not opts['notags']:
def tag_output():
- self.tags.write(self._outname)
+ try:
+ self.tags.write(self._outname)
+ except:
+ if opts['verbosity'] > 3:
+ import sys, traceback
+ traceback.print_exc(file=sys.stdout)
+ raise
return True
job = task.SimpleTask(self, tag_output, None,
lambda: True, name="Tagging")