X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fasset.cc;h=213d4878410e2553f7b48963da1ea185432d9f06;hb=ac5445d9ee7dbb6fd7dda08f965c661b01e26c90;hp=b69e68e8589d53c7e3e94cd09bee8525e5fdb5d8;hpb=96e1c1e817887ebf51d7f825306b26e8abe2f717;p=libdcp.git diff --git a/src/asset.cc b/src/asset.cc index b69e68e8..213d4878 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -41,6 +41,7 @@ #include "asset_map.h" #include "compose.hpp" #include "dcp_assert.h" +#include "equality_options.h" #include "exceptions.h" #include "pkl.h" #include "raw_convert.h" @@ -143,11 +144,15 @@ Asset::hash (function progress) const bool -Asset::equals (std::shared_ptr other, EqualityOptions, NoteHandler note) const +Asset::equals(std::shared_ptr other, EqualityOptions const& 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; @@ -158,7 +163,7 @@ void Asset::set_file (path file) const { _file = absolute (file); - _hash = boost::optional(); + _hash = optional(); } @@ -181,3 +186,11 @@ Asset::set_hash (string hash) { _hash = hash; } + + +void +Asset::unset_hash() +{ + _hash = optional(); +} +