Skip to content

Commit

Permalink
move_art: Remove missing album art
Browse files Browse the repository at this point in the history
Prevents a fatal file system error if the album art has been moved or renamed
and the beets library hasn't been manually updated.
  • Loading branch information
projectgus committed Sep 18, 2018
1 parent 3ddf3ef commit 58ce45a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions beets/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,12 @@ def move_art(self, operation=MoveOperation.MOVE):
if not old_art:
return

if not os.path.exists(old_art):
log.error(u'removing reference to missing album art file {}',
util.displayable_path(old_art))
self.artpath = None
return

new_art = self.art_destination(old_art)
if new_art == old_art:
return
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ Fixes:
* Improve error reporting: during startup if sqlite returns an error the
sqlite error message is attached to the beets message.
:bug:`3005`
* Missing album art file during an update no longer causes a fatal exception
(instead, an error is logged and the missing file path is removed from the
library).

.. _python-itunes: https://github.com/ocelma/python-itunes

Expand Down

0 comments on commit 58ce45a

Please sign in to comment.