diff --git a/beetsplug/replace.py b/beetsplug/replace.py index 532cc3d5b..0c9eb29cd 100644 --- a/beetsplug/replace.py +++ b/beetsplug/replace.py @@ -125,9 +125,8 @@ class ReplacePlugin(BeetsPlugin): except Exception as e: raise ui.UserError(f"Could not delete original file: {e}") - # Store the new path in the database. + # 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: @@ -135,4 +134,7 @@ class ReplacePlugin(BeetsPlugin): except Exception 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.")