_audio_language = dcp::LanguageTag(*audio_language);
}
+ /* Read the old ISDCFMetadata tag from 2.14.x metadata */
+ auto isdcf = f.optional_node_child("ISDCFMetadata");
+ if (isdcf) {
+ if (auto territory = isdcf->optional_string_child("Territory")) {
+ try {
+ _release_territory = dcp::LanguageTag::RegionSubtag(*territory);
+ } catch (...) {
+ /* Invalid region subtag; just ignore it */
+ }
+ }
+ if (auto audio_language = isdcf->optional_string_child("AudioLanguage")) {
+ try {
+ _audio_language = dcp::LanguageTag(*audio_language);
+ } catch (...) {
+ /* Invalid language tag; just ignore it */
+ }
+ }
+ if (auto content_version = isdcf->optional_string_child("ContentVersion")) {
+ _content_versions.push_back (*content_version);
+ }
+ if (auto rating = isdcf->optional_string_child("Rating")) {
+ _ratings.push_back (dcp::Rating("", *rating));
+ }
+ if (auto mastered_luminance = isdcf->optional_number_child<float>("MasteredLuminance")) {
+ _luminance = dcp::Luminance(*mastered_luminance, dcp::Luminance::Unit::FOOT_LAMBERT);
+ }
+ _studio = isdcf->optional_string_child("Studio");
+ _facility = isdcf->optional_string_child("Facility");
+ _temp_version = isdcf->optional_bool_child("TempVersion").get_value_or("false");
+ _pre_release = isdcf->optional_bool_child("PreRelease").get_value_or("false");
+ _red_band = isdcf->optional_bool_child("RedBand").get_value_or("false");
+ _two_d_version_of_three_d = isdcf->optional_bool_child("TwoDVersionOfThreeD").get_value_or("false");
+ _chain = isdcf->optional_string_child("Chain");
+ }
+
list<string> notes;
_playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes);
using std::string;
using std::list;
using std::make_shared;
+using std::vector;
BOOST_AUTO_TEST_CASE (film_metadata_test)
);
}
+
+BOOST_AUTO_TEST_CASE (metadata_loads_from_2_14_x_3)
+{
+ namespace fs = boost::filesystem;
+ auto film = make_shared<Film>(fs::path("build/test/metadata_loads_from_2_14_x_3"));
+ auto notes = film->read_metadata(fs::path("test/data/2.14.x.metadata.3.xml"));
+
+ BOOST_REQUIRE (film->release_territory());
+ BOOST_REQUIRE (film->release_territory()->subtag() == dcp::LanguageTag::RegionSubtag("de").subtag());
+
+ BOOST_REQUIRE (film->audio_language());
+ BOOST_REQUIRE (*film->audio_language() == dcp::LanguageTag("sv-SE"));
+
+ BOOST_REQUIRE (film->content_versions() == vector<string>{"3"});
+ BOOST_REQUIRE (film->ratings() == vector<dcp::Rating>{ dcp::Rating("", "214rating") });
+ BOOST_REQUIRE_EQUAL (film->studio().get_value_or(""), "214studio");
+ BOOST_REQUIRE_EQUAL (film->facility().get_value_or(""), "214facility");
+ BOOST_REQUIRE_EQUAL (film->temp_version(), true);
+ BOOST_REQUIRE_EQUAL (film->pre_release(), true);
+ BOOST_REQUIRE_EQUAL (film->red_band(), true);
+ BOOST_REQUIRE_EQUAL (film->two_d_version_of_three_d(), true);
+ BOOST_REQUIRE_EQUAL (film->chain().get_value_or(""), "214chain");
+ BOOST_REQUIRE (film->luminance() == dcp::Luminance(14, dcp::Luminance::Unit::FOOT_LAMBERT));
+}
+