diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-01-07 22:13:20 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-01-07 22:13:20 +0000 |
| commit | 083f242875671739241ad8bf7e6f436959b5d677 (patch) | |
| tree | 6ab4a53f884c7fb00d25c3d6df0b93af831013a8 | |
| parent | 9173d049cc256efebb6a5bf07ee98e14dc24a350 (diff) | |
Prevent creation of a DCP with missing content or DCP content that needs KDMs/OVs.
| -rw-r--r-- | src/lib/film.cc | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 68266b4ec..b337c50de 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -288,6 +288,35 @@ Film::make_dcp () throw BadSettingError (_("name"), _("cannot contain slashes")); } + if (container() == 0) { + throw MissingSettingError (_("container")); + } + + if (content().empty()) { + throw runtime_error (_("you must add some content to the DCP before creating it.")); + } + + if (dcp_content_type() == 0) { + throw MissingSettingError (_("content type")); + } + + if (name().empty()) { + throw MissingSettingError (_("name")); + } + + BOOST_FOREACH (shared_ptr<const Content> i, content ()) { + if (!i->paths_valid()) { + throw runtime_error (_("some of your content is missing.")); + } + shared_ptr<const DCPContent> dcp = dynamic_pointer_cast<const DCPContent> (i); + if (dcp && dcp->needs_kdm()) { + throw runtime_error (_("some of your content needs a KDM.")); + } + if (dcp && dcp->needs_assets()) { + throw runtime_error (_("some of your content needs an OV.")); + } + } + set_isdcf_date_today (); BOOST_FOREACH (string i, environment_info ()) { @@ -305,22 +334,6 @@ Film::make_dcp () } LOG_GENERAL ("J2K bandwidth %1", j2k_bandwidth()); - if (container() == 0) { - throw MissingSettingError (_("container")); - } - - if (content().empty()) { - throw runtime_error (_("You must add some content to the DCP before creating it")); - } - - if (dcp_content_type() == 0) { - throw MissingSettingError (_("content type")); - } - - if (name().empty()) { - throw MissingSettingError (_("name")); - } - JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this()))); } |
