From 95bca25cb6696724774474a35f5c316c127f3423 Mon Sep 17 00:00:00 2001 From: gardockt <42496375+gardockt@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:04:51 +0000 Subject: [PATCH] Tag editor: only write files with modified tags (#536) --- src/screens/tag_editor.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/screens/tag_editor.cpp b/src/screens/tag_editor.cpp index d754f499..5ad68382 100644 --- a/src/screens/tag_editor.cpp +++ b/src/screens/tag_editor.cpp @@ -798,13 +798,16 @@ void TagEditor::runAction() Statusbar::print("Writing changes..."); for (auto it = EditedSongs.begin(); it != EditedSongs.end(); ++it) { - Statusbar::printf("Writing tags in \"%1%\"...", (*it)->getName()); - if (!Tags::write(**it)) + if ((*it)->isModified()) { - Statusbar::printf("Error while writing tags to \"%1%\": %2%", - (*it)->getName(), strerror(errno)); - success = 0; - break; + Statusbar::printf("Writing tags in \"%1%\"...", (*it)->getName()); + if (!Tags::write(**it)) + { + Statusbar::printf("Error while writing tags to \"%1%\": %2%", + (*it)->getName(), strerror(errno)); + success = 0; + break; + } } } if (success)