Merge branch 'master' into 1264-unnecessary-resize

This commit is contained in:
reiv 2015-11-03 02:46:33 +01:00
commit 1625dfc17e
5 changed files with 37 additions and 3 deletions

View file

@ -585,7 +585,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

View file

@ -39,8 +39,8 @@ from beets.util.artresizer import ArtResizer, has_IM, has_PIL
BASE_DIR = os.path.join(BaseDirectory.xdg_cache_home, "thumbnails")
NORMAL_DIR = os.path.join(BASE_DIR, "normal")
LARGE_DIR = os.path.join(BASE_DIR, "large")
NORMAL_DIR = util.bytestring_path(os.path.join(BASE_DIR, "normal"))
LARGE_DIR = util.bytestring_path(os.path.join(BASE_DIR, "large"))
class ThumbnailsPlugin(BeetsPlugin):

View file

@ -18,6 +18,10 @@ Fixes:
Thanks to :user:`Freso`. :bug:`1661`
* :doc:`plugins/fetchart`: The plugin now only resizes album art if necessary,
rather than always by default. :bug:`1264`
* :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`
* :doc:`/plugins/thumbnails`: Fix a crash with Unicode paths. :bug:`1686`
1.3.15 (October 17, 2015)

View file

@ -208,6 +208,23 @@ Use the ``%asciify{}`` function in your path formats. See
:ref:`template-functions`.
.. _move-dir:
…point beets at a new music directory?
--------------------------------------
If you want to move your music from one directory to another, the best way is
to let beets do it for you. First, edit your configuration and set the
``directory`` setting to the new place. Then, type ``beet move`` to have beets
move all your files.
If you've already moved your music *outside* of beets, you have a few options:
- Move the music back (with an ordinary ``mv``) and then use the above steps.
- Delete your database and re-create it from the new paths using ``beet import -AWMC``.
- Resort to manually modifying the SQLite database (not recommended).
Why does beets…
===============

View file

@ -31,6 +31,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
@ -358,6 +359,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