Add LastWrittenBy to metadata (#2080).
authorCarl Hetherington <cth@carlh.net>
Sun, 19 Sep 2021 21:57:45 +0000 (23:57 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 19 Sep 2021 22:08:20 +0000 (00:08 +0200)
src/lib/film.cc
test/data
test/film_metadata_test.cc

index 486c1dd6a5ab91929bff0567338dd35a13162309..296066f58756d5d48e903cea458bc1202802cebc 100644 (file)
@@ -59,6 +59,7 @@
 #include "upload_job.h"
 #include "util.h"
 #include "video_content.h"
+#include "version.h"
 #include <libcxml/cxml.h>
 #include <dcp/certificate_chain.h>
 #include <dcp/cpl.h>
@@ -461,6 +462,9 @@ Film::metadata (bool with_content_paths) const
        auto root = doc->create_root_node ("Metadata");
 
        root->add_child("Version")->add_child_text (raw_convert<string> (current_state_version));
+       auto last_write = root->add_child("LastWrittenBy");
+       last_write->add_child_text (dcpomatic_version);
+       last_write->set_attribute("git", dcpomatic_git_commit);
        root->add_child("Name")->add_child_text (_name);
        root->add_child("UseISDCFName")->add_child_text (_use_isdcf_name ? "1" : "0");
 
index ea55876b67767a6a4a9474a4af860c51dc9ee9ec..9a5f520e6106d259c9fb4bd364fb0a881a599f7f 160000 (submodule)
--- a/test/data
+++ b/test/data
@@ -1 +1 @@
-Subproject commit ea55876b67767a6a4a9474a4af860c51dc9ee9ec
+Subproject commit 9a5f520e6106d259c9fb4bd364fb0a881a599f7f
index f1313497adae172d82fbe3396a9c29d1a169ee97..029b990e9d0ffbc5886535d4df13995882e3a7dc 100644 (file)
@@ -41,7 +41,6 @@
 using std::string;
 using std::list;
 using std::make_shared;
-using std::shared_ptr;
 
 
 BOOST_AUTO_TEST_CASE (film_metadata_test)
@@ -64,7 +63,7 @@ BOOST_AUTO_TEST_CASE (film_metadata_test)
        film->set_release_territory (dcp::LanguageTag::RegionSubtag("US"));
        film->write_metadata ();
 
-       list<string> ignore = { "Key", "ContextID" };
+       list<string> ignore = { "Key", "ContextID", "LastWrittenBy" };
        check_xml ("test/data/metadata.xml.ref", dir.string() + "/metadata.xml", ignore);
 
        auto g = make_shared<Film>(dir);