mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 19:42:42 +01:00
Merge pull request #1682 from sampsyo/1126-deleted-art
Fix #1126: Check if album art file actually exists
This commit is contained in:
commit
f891184f0a
3 changed files with 17 additions and 1 deletions
|
|
@ -567,7 +567,7 @@ class FetchArtPlugin(plugins.BeetsPlugin, RequestMixin):
|
|||
fetchart CLI command.
|
||||
"""
|
||||
for album in albums:
|
||||
if album.artpath and not force:
|
||||
if album.artpath and not force and os.path.isfile(album.artpath):
|
||||
message = ui.colorize('text_highlight_minor', 'has album art')
|
||||
else:
|
||||
# In ordinary invocations, look for images on the
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ Fixes:
|
|||
when there were not. :bug:`1652`
|
||||
* :doc:`plugins/lastgenre`: Clean up the reggae related genres somewhat.
|
||||
Thanks to :user:`Freso`. :bug:`1661`
|
||||
* :doc:`plugins/fetchart`: Fix a bug where a database reference to a
|
||||
non-existent album art file would prevent the command from fetching new art.
|
||||
:bug:`1126`
|
||||
|
||||
|
||||
1.3.15 (October 17, 2015)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ from beets import library
|
|||
from beets import importer
|
||||
from beets import config
|
||||
from beets import logging
|
||||
from beets import util
|
||||
from beets.util.artresizer import ArtResizer, WEBPROXY
|
||||
|
||||
|
||||
|
|
@ -357,6 +358,18 @@ class ArtImporterTest(UseThePlugin):
|
|||
self.afa_response = artdest
|
||||
self._fetch_art(True)
|
||||
|
||||
def test_fetch_art_if_imported_file_deleted(self):
|
||||
# See #1126. Test the following scenario:
|
||||
# - Album art imported, `album.artpath` set.
|
||||
# - Imported album art file subsequently deleted (by user or other
|
||||
# program).
|
||||
# `fetchart` should import album art again instead of printing the
|
||||
# message "<album> has album art".
|
||||
self._fetch_art(True)
|
||||
util.remove(self.album.artpath)
|
||||
self.plugin.batch_fetch_art(self.lib, self.lib.albums(), force=False)
|
||||
self.assertExists(self.album.artpath)
|
||||
|
||||
|
||||
class ArtForAlbumTest(UseThePlugin):
|
||||
""" Tests that fetchart.art_for_album respects the size
|
||||
|
|
|
|||
Loading…
Reference in a new issue