1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
eyeD3 only accepts years that have 4 digits; catch the exception in case
the year contains something else. Debian bug http://bugs.debian.org/478784
--- a/jack_tag.py 2008-05-04 16:28:14.000000000 +0200
+++ b/jack_tag.py 2008-05-04 16:38:50.000000000 +0200
@@ -112,7 +112,10 @@
if cf['_id3_genre'] != -1:
tag.setGenre("(%d)" % (cf['_id3_genre']))
if cf['_id3_year'] != -1:
- tag.setDate(cf['_id3_year'])
+ try:
+ tag.setDate(cf['_id3_year'])
+ except eyeD3.tag.TagException, e:
+ print "Error tagging file: %s" % e
tag.setPlayCount(int(i[LEN] * 1000.0 / 75 + 0.5))
tag.update()
mp3file.close()
@@ -139,7 +142,10 @@
elif old_genre == None:
tag.setGenre("(255)") # unknown
if cf['_id3_year'] != -1:
- tag.setDate(cf['_id3_year'])
+ try:
+ tag.setDate(cf['_id3_year'])
+ except eyeD3.tag.TagException, e:
+ print "Error tagging file: %s" % e
try:
tag.update()
except UnicodeEncodeError:
|