Fix hyphen in filename #4

This commit is contained in:
NicoHood 2016-04-05 23:11:48 +02:00
parent d71be4f9fb
commit 5b2a4a2a36

View file

@ -327,7 +327,11 @@ class Track(Record):
self["filetype"] = 2 self["filetype"] = 2
text = os.path.splitext(os.path.basename(filename))[0] text = os.path.splitext(os.path.basename(filename))[0]
audio = None
try:
audio = mutagen.File(filename, easy = True) audio = mutagen.File(filename, easy = True)
except:
print "Error calling mutagen. Possible invalid filename/ID3Tags (hyphen in filename?)"
if audio: if audio:
# Note: Rythmbox IPod plugin sets this value always 0. # Note: Rythmbox IPod plugin sets this value always 0.
self["stop_at_pos_ms"] = int(audio.info.length * 1000) self["stop_at_pos_ms"] = int(audio.info.length * 1000)