diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-11-18 01:31:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-11-20 23:47:03 +0100 |
| commit | 84a0d8a228f36f95ac265bac163c8e3f02dc1fd0 (patch) | |
| tree | ed7a3bf3a9d0806ddb3a9ea6196230dfeaa1679e /src/lib/writer.cc | |
| parent | 7ec57dea9d77070244c411c354623cfb5bac09ca (diff) | |
Remove subtitle language from text content.
Diffstat (limited to 'src/lib/writer.cc')
| -rw-r--r-- | src/lib/writer.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 346cbb0c2..79e5ad73b 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -660,15 +660,12 @@ Writer::write_cover_sheet () boost::algorithm::replace_all (text, "$CONTAINER", _film->container()->container_nickname()); boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", _film->isdcf_metadata().audio_language); - optional<string> subtitle_language; - BOOST_FOREACH (shared_ptr<Content> i, _film->content()) { - BOOST_FOREACH (shared_ptr<TextContent> j, i->text) { - if (j->type() == TEXT_OPEN_SUBTITLE && j->use()) { - subtitle_language = j->language (); - } - } + vector<dcp::LanguageTag> subtitle_languages = _film->subtitle_languages(); + if (subtitle_languages.empty()) { + boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", "None"); + } else { + boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", subtitle_languages.front().description()); } - boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", subtitle_language.get_value_or("None")); boost::uintmax_t size = 0; for ( |
