From 034bb175e6884cb87a1cb559e44f8c7a588be5d8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 23:20:56 +0000 Subject: [PATCH] Fix code review issues - Apply modifications in SaveFileWithFallback before attempting direct save - Remove duplicate return statement in SaveSongRating Co-authored-by: jonaski <10343810+jonaski@users.noreply.github.com> --- src/tagreader/tagreadertaglib.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tagreader/tagreadertaglib.cpp b/src/tagreader/tagreadertaglib.cpp index ccc6ea798..08065b809 100644 --- a/src/tagreader/tagreadertaglib.cpp +++ b/src/tagreader/tagreadertaglib.cpp @@ -306,6 +306,13 @@ bool TagReaderTagLib::SaveFileWithFallback(const QString &filename, const std::f return false; } + // Apply modifications using the callback + if (!save_function(fileref.get())) { + qLog(Error) << "Failed to apply modifications to file" << filename; + return false; + } + + // Try direct save first if (fileref->save()) { qLog(Debug) << "Successfully saved file directly" << filename; return true; @@ -2181,8 +2188,6 @@ TagReaderResult TagReaderTagLib::SaveSongRating(const QString &filename, const f return success ? TagReaderResult::ErrorCode::Success : TagReaderResult::ErrorCode::FileSaveError; - return success ? TagReaderResult::ErrorCode::Success : TagReaderResult::ErrorCode::FileSaveError; - } TagLib::String TagReaderTagLib::TagLibStringListToSlashSeparatedString(const TagLib::StringList &taglib_string_list, const uint begin_index) {