move_art: Remove missing album art

Prevents a fatal file system error if the album art has been moved or renamed
and the beets library hasn't been manually updated.
This commit is contained in:
Angus Gratton 2018-09-10 09:16:25 +10:00
parent 6a92fa8b70
commit e58ddbfa1a
2 changed files with 9 additions and 0 deletions

View file

@ -1030,6 +1030,12 @@ class Album(LibModel):
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

View file

@ -86,6 +86,9 @@ Fixes:
* Fix a problem when resizing images with PIL/Pillow on Python 3.
Thanks to :user:`architek`.
:bug:`2504` :bug:`3029`
* 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). :bug:`3030`
.. _python-itunes: https://github.com/ocelma/python-itunes