From 5b2a4a2a3637aed2ec0bc4ed58e10345ae968951 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Tue, 5 Apr 2016 23:11:48 +0200 Subject: [PATCH] Fix hyphen in filename #4 --- shuffle.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shuffle.py b/shuffle.py index c4cff6c..502cbc6 100755 --- a/shuffle.py +++ b/shuffle.py @@ -327,7 +327,11 @@ class Track(Record): self["filetype"] = 2 text = os.path.splitext(os.path.basename(filename))[0] - audio = mutagen.File(filename, easy = True) + audio = None + try: + audio = mutagen.File(filename, easy = True) + except: + print "Error calling mutagen. Possible invalid filename/ID3Tags (hyphen in filename?)" if audio: # Note: Rythmbox IPod plugin sets this value always 0. self["stop_at_pos_ms"] = int(audio.info.length * 1000)