diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-03-31 15:20:19 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-04-01 23:43:00 +0200 |
| commit | 01e7bb0bb80f50466912800bd327ec4f0d733542 (patch) | |
| tree | 535a587059ad0117b400c37f46cfb41141751893 | |
| parent | d7f52153b4e50858dcd382fb66c51afba0bf6029 (diff) | |
DUPLICATE_ASSET_ID_IN_ASSETMAP: note -> asset_map_id.
| -rw-r--r-- | src/verify.cc | 9 | ||||
| -rw-r--r-- | src/verify.h | 12 | ||||
| -rw-r--r-- | test/verify_test.cc | 4 |
3 files changed, 20 insertions, 5 deletions
diff --git a/src/verify.cc b/src/verify.cc index caf2db03..094567da 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -1840,7 +1840,7 @@ verify_assetmap(Context& context, shared_ptr<const DCP> dcp) set<string> uuid_set; for (auto const& asset: asset_map->assets()) { if (!uuid_set.insert(asset.id()).second) { - context.add_note(VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP, asset_map->id(), asset_map->file().get()); + context.add_note(VerificationNote(VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP, asset_map->file().get()).set_asset_map_id(asset_map->id())); break; } } @@ -2181,7 +2181,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str case VerificationNote::Code::DUPLICATE_ASSET_ID_IN_PKL: return compose("The PKL %1 has more than one asset with the same ID.", *note.pkl_id()); case VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP: - return compose("The ASSETMAP %1 has more than one asset with the same ID.", note.note().get()); + return compose("The ASSETMAP %1 has more than one asset with the same ID.", *note.asset_map_id()); case VerificationNote::Code::MISSING_SUBTITLE: return compose("The subtitle asset %1 has no subtitles.", note.note().get()); case VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE: @@ -2372,6 +2372,7 @@ dcp::operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b) a.frame_rate() == b.frame_rate() && a.cpl_id() == b.cpl_id() && a.pkl_id() == b.pkl_id() && + a.asset_map_id() == b.asset_map_id() && a.reference_hash() == b.reference_hash() && a.calculated_hash() == b.calculated_hash() && a.reel_index() == b.reel_index() && @@ -2515,6 +2516,10 @@ dcp::operator< (dcp::VerificationNote const& a, dcp::VerificationNote const& b) return less_than_optional(a.pkl_id(), b.pkl_id()); } + if (a.asset_map_id() != b.asset_map_id()) { + return less_than_optional(a.asset_map_id(), b.asset_map_id()); + } + if (a.reference_hash() != b.reference_hash()) { return less_than_optional(a.reference_hash(), b.reference_hash()); } diff --git a/src/verify.h b/src/verify.h index 07a480a7..2fb6b0ef 100644 --- a/src/verify.h +++ b/src/verify.h @@ -515,7 +515,7 @@ public: */ DUPLICATE_ASSET_ID_IN_PKL, /** An ASSETMAP has more than one asset with the same ID - * note contains the ASSETMAP ID + * asset_map_id contains the ASSETMAP ID * file contains the ASSETMAP filename */ DUPLICATE_ASSET_ID_IN_ASSETMAP, @@ -645,6 +645,7 @@ private: enum class Data { ANNOTATION_TEXT, ASSET_ID, + ASSET_MAP_ID, BIT_DEPTH, CALCULATED_HASH, CAPABILITIES, @@ -803,6 +804,15 @@ public: return data<std::string>(Data::PKL_ID); } + VerificationNote& set_asset_map_id(std::string id) { + _data[Data::ASSET_MAP_ID] = id; + return *this; + } + + boost::optional<std::string> asset_map_id() const { + return data<std::string>(Data::ASSET_MAP_ID); + } + VerificationNote& set_reel_index(int index) { _data[Data::REEL_INDEX] = index; return *this; diff --git a/test/verify_test.cc b/test/verify_test.cc index 87e57b71..737da1e9 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -5188,8 +5188,8 @@ BOOST_AUTO_TEST_CASE(verify_duplicate_assetmap_asset_ids) note(VC::VALID_CONTENT_VERSION_LABEL_TEXT, cpl->content_version()->label_text, cpl), note(VC::NONE_ENCRYPTED, cpl), VN( - VC::DUPLICATE_ASSET_ID_IN_ASSETMAP, asset_map.id(), canonical(find_asset_map(dir)) - ), + VC::DUPLICATE_ASSET_ID_IN_ASSETMAP, canonical(find_asset_map(dir)) + ).set_asset_map_id(asset_map.id()), VN(VC::EXTERNAL_ASSET).set_asset_id("5407b210-4441-4e97-8b16-8bdc7c12da54"), }); } |
