- string text = Config::instance()->cover_sheet ();
- boost::algorithm::replace_all (text, "$CPL_NAME", _film->name());
- boost::algorithm::replace_all (text, "$TYPE", _film->dcp_content_type()->pretty_name());
- boost::algorithm::replace_all (text, "$CONTAINER", _film->container()->container_nickname());
- boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", _film->isdcf_metadata().audio_language);
- boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", _film->isdcf_metadata().subtitle_language);
+ auto text = Config::instance()->cover_sheet ();
+ boost::algorithm::replace_all (text, "$CPL_NAME", film()->name());
+ auto cpls = film()->cpls();
+ if (!cpls.empty()) {
+ boost::algorithm::replace_all (text, "$CPL_FILENAME", cpls[0].cpl_file.filename().string());
+ }
+ boost::algorithm::replace_all (text, "$TYPE", film()->dcp_content_type()->pretty_name());
+ boost::algorithm::replace_all (text, "$CONTAINER", film()->container()->container_nickname());
+
+ auto audio_language = film()->audio_language();
+ if (audio_language) {
+ boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", audio_language->description());
+ } else {
+ boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", _("None"));
+ }
+
+ auto subtitle_languages = film()->subtitle_languages();
+ if (subtitle_languages.first) {
+ boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", subtitle_languages.first->description());
+ } else {
+ boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", _("None"));
+ }