beets/beets
Antoine Beaupré df2ea34183
Draft: handle file exceptions correctly in move, art_set, and move_art
This reflects the `try_write` approach will handles write failures
elegantly, by logging the error and continuing. We do the same with
`move`, `art_set` and `move_art`.

We also handle exceptions on `before_item_moved` and `art_set` plugins
hooks, the latter of which is moved *before* the file operations to
remain consistent with other hook configurations.

That might be a mistake and API-breaking change, another approach
would be to have a new `before_art_set` hook instead.

We also introduce a new hook (`move_art`) for those operations as
well.

The point of this patch is to make it possible for plugins to send a
signal (through the already FileOperationError exception) to callers
that it should skip a specific item or artwork.

This is essential to allow beets to better integrate with other
utilities like bittorrent clients which may rewrite those files. The
rationale here is that some music collections will have *parts* of
them managed by such clients in which case we should be careful not to
overwrite or move those files.

Operations like copy or hardlink are not handled by this, for that
reason. We may also want to do proper error handling for those as
well, that said, but that seems out of scope for this specific
issue (#2617).
2022-01-13 11:46:18 -05:00
..
autotag Fix up invalid master merges 2021-09-26 17:33:15 +10:00
dbcore Use short-circuit evaluation in AndQuery and OrQuery (fix #4145) 2021-11-16 21:44:57 +01:00
ui Send the pluginload event after types and queries are available 2021-11-15 21:27:39 -07:00
util Two more syspath calls 2022-01-05 16:15:39 -08:00
__init__.py Switch version to 1.6.0 2021-11-27 11:17:14 -05:00
__main__.py pyupgrade beets dir 2021-08-25 16:05:28 +10:00
art.py pyupgrade beets dir 2021-08-25 16:05:28 +10:00
config_default.yaml Change behavior to HTTPS by default for musicbrainz.org, but HTTP by default for custom servers 2021-05-04 16:07:08 +02:00
importer.py Draft: handle file exceptions correctly in move, art_set, and move_art 2022-01-13 11:46:18 -05:00
library.py Draft: handle file exceptions correctly in move, art_set, and move_art 2022-01-13 11:46:18 -05:00
logging.py fix unused import and flake8 2021-08-25 19:07:55 +10:00
mediafile.py pyupgrade beets dir 2021-08-25 16:05:28 +10:00
plugins.py fix unused import and flake8 2021-08-25 19:07:55 +10:00
random.py pyupgrade beets dir 2021-08-25 16:05:28 +10:00
vfs.py pyupgrade beets dir 2021-08-25 16:05:28 +10:00