diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-31 02:10:47 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-15 17:13:38 +0100 |
| commit | 2e6daea080b74d251d2107735e58c7ea2fe9c559 (patch) | |
| tree | 7a63cb2e089234d75e81c3e7a0d62ed231b65f97 | |
| parent | 24ffe184df886bf03c359b3e587378db44f7e42a (diff) | |
Use new asset_map_id for DUPLICATE_ASSET_ID_IN_ASSETMAP.
| -rw-r--r-- | src/verify.cc | 7 | ||||
| -rw-r--r-- | src/verify.h | 12 | ||||
| -rw-r--r-- | test/verify_test.cc | 4 |
3 files changed, 18 insertions, 5 deletions
diff --git a/src/verify.cc b/src/verify.cc index 9a12f6bc..d1a96c3f 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -1865,10 +1865,12 @@ verify_assetmap(Context& context, shared_ptr<const DCP> dcp) validate_xml(context, asset_map->file().get()); + using VN = dcp::VerificationNote; + set<string> uuid_set; for (auto const& asset: asset_map->assets()) { if (!uuid_set.insert(asset.id()).second) { - context.error(VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP, asset_map->id(), asset_map->file().get()); + context.add_note(VN(VN::Type::ERROR, VN::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP, asset_map->file().get()).set_asset_map_id(asset_map->id())); break; } } @@ -2214,7 +2216,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().get()); 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().get()); case VerificationNote::Code::MISSING_SUBTITLE: return compose("The subtitle asset %1 has no subtitles.", note.asset_id().get()); case VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE: @@ -2272,6 +2274,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() && diff --git a/src/verify.h b/src/verify.h index fa8ac446..d51b6afd 100644 --- a/src/verify.h +++ b/src/verify.h @@ -479,7 +479,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, @@ -608,6 +608,7 @@ private: FRAME_RATE, CPL_ID, PKL_ID, + ASSET_MAP_ID, CALCULATED_HASH, REFERENCE_HASH, REEL_INDEX, ///< reel index, counting from 0 @@ -764,6 +765,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 e9df5ac5..209445ab 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -5321,8 +5321,8 @@ BOOST_AUTO_TEST_CASE(verify_duplicate_assetmap_asset_ids) ok(dcp::VerificationNote::Code::VALID_CONTENT_VERSION_LABEL_TEXT, cpl).set_content_version(cpl->content_version()->label_text), ok(dcp::VerificationNote::Code::NONE_ENCRYPTED, cpl), dcp::VerificationNote( - dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP, asset_map.id(), canonical(find_asset_map(dir)) - ), + dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP, canonical(find_asset_map(dir)) + ).set_asset_map_id(asset_map.id()), dcp::VerificationNote( dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::EXTERNAL_ASSET ).set_asset_id("5407b210-4441-4e97-8b16-8bdc7c12da54") |
