boost::filesystem::path result;
for (boost::filesystem::path::iterator i = p.begin(); i != p.end(); ++i) {
if (*i == "..") {
- if (boost::filesystem::is_symlink (result) || result.filename() == "..") {
+ boost::system::error_code ec;
+ if (boost::filesystem::is_symlink(result, ec) || result.filename() == "..") {
result /= *i;
} else {
result = result.parent_path ();
throw runtime_error (_("You must add some content to the DCP before creating it"));
}
+ if (length() == DCPTime()) {
+ throw runtime_error (_("The DCP is empty, perhaps because all the content has zero length."));
+ }
+
if (dcp_content_type() == 0) {
throw MissingSettingError (_("content type"));
}
BOOST_FOREACH (dcp::Rating i, _ratings) {
i.as_xml (root->add_child("Rating"));
}
+ root->add_child("ContentVersion")->add_child_text(_content_version);
_playlist->as_xml (root->add_child ("Playlist"), with_content_paths);
return doc;
_ratings.push_back (dcp::Rating(i));
}
+ _content_version = f.optional_string_child("ContentVersion").get_value_or("");
+
list<string> notes;
_playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes);
_ratings = r;
}
+void
+Film::set_content_version (string v)
+{
+ ChangeSignaller<Film> ch (this, CONTENT_VERSION);
+ _content_version = v;
+}
+
optional<DCPTime>
Film::marker (dcp::Marker type) const
{