mirror of
https://github.com/beetbox/beets.git
synced 2026-02-24 00:02:20 +01:00
Fix music-crawl error messages (thanks, derwin)
Due to the new exception nesting stuff, we were catching and emitting exceptions where none was necessary: specifically, when the file was non-music (which is expected, especially when there are images).
This commit is contained in:
parent
60c59ca96a
commit
945e30d155
1 changed files with 12 additions and 9 deletions
|
|
@ -52,16 +52,19 @@ def albums_in_dir(path):
|
|||
for filename in files:
|
||||
try:
|
||||
i = library.Item.from_path(os.path.join(root, filename))
|
||||
except mediafile.FileTypeError:
|
||||
pass
|
||||
except mediafile.UnreadableFileError:
|
||||
log.warn(u'unreadable file: {0}'.format(
|
||||
displayable_path(filename))
|
||||
)
|
||||
except library.ReadError as exc:
|
||||
log.error(u'error reading {0}: {1}'.format(
|
||||
displayable_path(filename), exc
|
||||
))
|
||||
if isinstance(exc.reason, mediafile.FileTypeError):
|
||||
# Silently ignore non-music files.
|
||||
pass
|
||||
elif isinstance(exc.reason, mediafile.UnreadableFileError):
|
||||
log.warn(u'unreadable file: {0}'.format(
|
||||
displayable_path(filename))
|
||||
)
|
||||
else:
|
||||
log.error(u'error reading {0}: {1}'.format(
|
||||
displayable_path(filename),
|
||||
exc,
|
||||
))
|
||||
else:
|
||||
items.append(i)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue