Save new path before writing metadata

This commit is contained in:
Will Burden 2025-12-13 14:53:11 +00:00
parent 99c7820605
commit 53efa03785

View file

@ -129,6 +129,7 @@ class ReplacePlugin(BeetsPlugin):
# Update the path to point to the new file.
song.path = str(dest).encode()
song.store()
# Write the metadata in the database to the song file's tags.
try:
@ -136,7 +137,4 @@ class ReplacePlugin(BeetsPlugin):
except FileOperationError as e:
raise ui.UserError(f"Error writing metadata to file: {e}")
# Commit the new path to the database.
song.store()
ui.print_("Replacement successful.")