summaryrefslogtreecommitdiff
path: root/src/asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-06-28 23:00:57 +0200
committerCarl Hetherington <cth@carlh.net>2023-06-29 01:25:46 +0200
commitb3b70e6d7c2ec6787d0b492442bb4f7537b4b580 (patch)
treef1b9f14b5c8e9831e7bd23bc7e88817132511a31 /src/asset.cc
parente702623781c8d5853b79a29ca8c5f495d0ade3d1 (diff)
Add asset_hashes_can_differ option to the equality checks.v1.8.74
Before recent changes Asset::_hash would be empty when the equality checks were run (and Asset::equals() compares them directly). This mean that differences in asset hash were being ignored, but are no longer; so now we need this option to restore that behaviour where required.
Diffstat (limited to 'src/asset.cc')
-rw-r--r--src/asset.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/asset.cc b/src/asset.cc
index d88c690d..330bd653 100644
--- a/src/asset.cc
+++ b/src/asset.cc
@@ -143,11 +143,15 @@ Asset::hash (function<void (float)> progress) const
bool
-Asset::equals (std::shared_ptr<const Asset> other, EqualityOptions, NoteHandler note) const
+Asset::equals(std::shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler note) const
{
if (_hash != other->_hash) {
- note (NoteType::ERROR, "Asset: hashes differ");
- return false;
+ if (!opt.asset_hashes_can_differ) {
+ note(NoteType::ERROR, "Asset: hashes differ");
+ return false;
+ } else {
+ note(NoteType::NOTE, "Asset: hashes differ");
+ }
}
return true;