mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 13:07:09 +01:00
now catch MPEG frame errors
--HG-- extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40126
This commit is contained in:
parent
9ac8134979
commit
6a4cb750d3
1 changed files with 5 additions and 1 deletions
|
|
@ -357,7 +357,11 @@ class MediaFile(object):
|
|||
metadata."""
|
||||
|
||||
def __init__(self, path):
|
||||
self.mgfile = mutagen.File(path)
|
||||
try:
|
||||
self.mgfile = mutagen.File(path)
|
||||
except mutagen.mp3.HeaderNotFoundError:
|
||||
raise FileTypeError('Mutagen could not read file')
|
||||
|
||||
if self.mgfile is None: # Mutagen couldn't guess the type
|
||||
raise FileTypeError('file type unsupported by Mutagen')
|
||||
elif type(self.mgfile).__name__ == 'M4A' or \
|
||||
|
|
|
|||
Loading…
Reference in a new issue