cc-4105: fixed bug where program would crash on non integer track numbers

This commit is contained in:
Rudi Grinberg 2012-08-07 16:57:35 -04:00
parent a576af2482
commit bcb65c4269
6 changed files with 24 additions and 13 deletions

View file

@ -123,8 +123,10 @@ class Metadata(Loggable):
for k,v in full_mutagen.iteritems():
# Special handling of attributes here
if isinstance(v, list):
if len(v) == 1: metadata[k] = v[0]
else: raise Exception("Unknown mutagen %s:%s" % (k,str(v)))
# TODO : some files have multiple fields for the same metadata.
# genre is one example. In that case mutagen will return a list
# of values
metadata[k] = v[0]
else: metadata[k] = v
self.__metadata = {}
# Start populating a dictionary of airtime metadata in __metadata