[Do not merge] Also remove embedded art if deleted from the library #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Split out of #17, this PR is relative to #17. This is not really the solution to the problem (see code comment about performance issues), the PR is mostly to track the issue and conserve the code that was written already.
I don't think that this is the way to go because the check for whether artwork needs to be removed currently requires reading metadata from the file in the alternative collection. This is probably (didn't benchmark anything) no faster than simply re-writing all of the tags blindly. So it might be worth considering to simply to tolerate this edge case not being handled (I do not believe that artwork removal is a very common thing to do). One might add a
beet alt update --rewrite
flag to precisely rewrite tags (including embedded art) for all items in the alt collection.Another way to handle this might be to use an additional flexattr to track whether the alternative items have embedded art, e.g.
item[self.path_key + '.flags'] = 'has_art,'
.