-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #314: Delete old album art during re-import #1681
Conversation
First step towards fixing #314.
# to None, making self.prune() a no-op; hence this workaround of | ||
# calling util.prune_dirs() directly. | ||
util.prune_dirs(os.path.dirname(old_art_path), | ||
clutter=config['clutter'].as_str_seq()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should leave any changes to pruning to a separate fix—let's just focus on album art for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is, unless pruning for import -L
works fine except for album art and this is just needed to keep the current functionality intact.
Here, we should probably write a test for two different situations:
In both cases, we should verify that we end up with exactly one image file (not two). Also, while this strategy might work, it does have a drawback: we have to copy the image and then delete the old file. We should keep in mind an alternative, where either the importer or the |
I'm fairly certain that #1683 takes care of the first case, but it can't hurt to add more tests. As for the second case, a move could also be triggered by modifying the path templates, though I think we can treat that the same way as a metadata change. I've taken a gander at the tests for re-imports located in Regarding your second point: I've been thinking about this as well. A better approach might indeed be to let the importer handle it. Specifically, we would need to grab the |
Hmm; the way I read it, the
Yes, exactly! That would be ideal. The remaining decision is whether the importer should be responsible or |
Ensure that album art is preserved when an album is re-imported.
Copy the replaced album's artpath attribute to the new album. This causes the image file to be moved along with the music files.
Going with this approach simplified things a lot, actually; the fix was a one-liner. Now we'd have to make |
Make sure that when an album is re-imported and its files are moved, the artwork isn't left behind in the old folder.
Awesome! I'm so excited the fix could be that simple. Woohoo! It depends on when the plugins run, but ideally, a plugin should be able to inspect the task's |
Me too! Turns out the mechanism was already there, it was just missing a single cog for it to work. Anyway, if the |
When re-importing an album, we don't want fetchart to interfere with any existing album art.
Can we merge this PR? |
Yes, looks 100% ready. Thanks again! ✨ |
Fix #314: Delete old album art during re-import
Part of #1679 by @reiv.