summaryrefslogtreecommitdiff
path: root/src/dcp.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-04-25 21:59:26 +0200
committerCarl Hetherington <cth@carlh.net>2022-04-25 21:59:26 +0200
commitba7d09616f8e529d71ff1e7843f39f22d2823409 (patch)
tree36e2c83a89239c29d45fb40356bec58dc831d99c /src/dcp.cc
parent7c24b62d51e0ddf14af451ef5a543f07b69f111e (diff)
Update PKL assets before writing it.
Diffstat (limited to 'src/dcp.cc')
-rw-r--r--src/dcp.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index 5da4bbd6..f7b83b01 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -400,16 +400,16 @@ DCP::write_xml (
i->write_xml (_directory / (name_format.get(values, "_" + i->id() + ".xml")), signer);
}
- shared_ptr<PKL> pkl;
-
if (_pkls.empty()) {
- pkl = make_shared<PKL>(standard, annotation_text, issue_date, issuer, creator);
- _pkls.push_back (pkl);
- for (auto i: assets()) {
- i->add_to_pkl (pkl, _directory);
- }
- } else {
- pkl = _pkls.front ();
+ _pkls.push_back(make_shared<PKL>(standard, annotation_text, issue_date, issuer, creator));
+ }
+
+ auto pkl = _pkls.front();
+
+ /* The assets may have changed since we read the PKL, so re-add them */
+ pkl->clear_assets();
+ for (auto asset: assets()) {
+ asset->add_to_pkl(pkl, _directory);
}
NameFormat::Map values;