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>
This commit is contained in:
@@ -306,6 +306,13 @@ bool TagReaderTagLib::SaveFileWithFallback(const QString &filename, const std::f
|
|||||||
return false;
|
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()) {
|
if (fileref->save()) {
|
||||||
qLog(Debug) << "Successfully saved file directly" << filename;
|
qLog(Debug) << "Successfully saved file directly" << filename;
|
||||||
return true;
|
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;
|
||||||
|
|
||||||
return success ? TagReaderResult::ErrorCode::Success : TagReaderResult::ErrorCode::FileSaveError;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TagLib::String TagReaderTagLib::TagLibStringListToSlashSeparatedString(const TagLib::StringList &taglib_string_list, const uint begin_index) {
|
TagLib::String TagReaderTagLib::TagLibStringListToSlashSeparatedString(const TagLib::StringList &taglib_string_list, const uint begin_index) {
|
||||||
|
|||||||
Reference in New Issue
Block a user