-CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, KDMNameFormat name_format, dcp::NameFormat::Map name_values) const
+CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, dcp::NameFormat name_format, dcp::NameFormat::Map name_values) const
BOOST_FOREACH (ScreenKDM const & i, screen_kdms) {
shared_ptr<string> kdm (new string (i.kdm.as_xml ()));
BOOST_FOREACH (ScreenKDM const & i, screen_kdms) {
shared_ptr<string> kdm (new string (i.kdm.as_xml ()));
string const name = name_format.get(name_values) + ".xml";
if (zip_add (zip, name.c_str(), source) == -1) {
throw runtime_error ("failed to add KDM to ZIP archive");
string const name = name_format.get(name_values) + ".xml";
if (zip_add (zip, name.c_str(), source) == -1) {
throw runtime_error ("failed to add KDM to ZIP archive");
CinemaKDMs::write_zip_files (
list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
CinemaKDMs::write_zip_files (
list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
BOOST_FOREACH (CinemaKDMs const & i, cinema_kdms) {
boost::filesystem::path path = directory;
BOOST_FOREACH (CinemaKDMs const & i, cinema_kdms) {
boost::filesystem::path path = directory;
path /= name_format.get(name_values) + ".zip";
i.make_zip_file (path, name_format, name_values);
}
path /= name_format.get(name_values) + ".zip";
i.make_zip_file (path, name_format, name_values);
}
boost::filesystem::path zip_file = boost::filesystem::temp_directory_path ();
zip_file /= boost::filesystem::unique_path().string() + ".zip";
boost::filesystem::path zip_file = boost::filesystem::temp_directory_path ();
zip_file /= boost::filesystem::unique_path().string() + ".zip";
string subject = config->kdm_subject();
boost::algorithm::replace_all (subject, "$CPL_NAME", cpl_name);
string subject = config->kdm_subject();
boost::algorithm::replace_all (subject, "$CPL_NAME", cpl_name);
- boost::algorithm::replace_all (subject, "$START_TIME", name_values["from"]);
- boost::algorithm::replace_all (subject, "$END_TIME", name_values["to"]);
+ boost::algorithm::replace_all (subject, "$START_TIME", name_values['f']);
+ boost::algorithm::replace_all (subject, "$END_TIME", name_values['t']);
boost::algorithm::replace_all (subject, "$CINEMA_NAME", i.cinema->name);
string body = config->kdm_email().c_str();
boost::algorithm::replace_all (body, "$CPL_NAME", cpl_name);
boost::algorithm::replace_all (subject, "$CINEMA_NAME", i.cinema->name);
string body = config->kdm_email().c_str();
boost::algorithm::replace_all (body, "$CPL_NAME", cpl_name);
- boost::algorithm::replace_all (body, "$START_TIME", name_values["from"]);
- boost::algorithm::replace_all (body, "$END_TIME", name_values["to"]);
+ boost::algorithm::replace_all (body, "$START_TIME", name_values['f']);
+ boost::algorithm::replace_all (body, "$END_TIME", name_values['t']);
- boost::algorithm::replace_all (body, "$SCREENS", screens.str().substr (0, screens.str().length() - 2));
+ boost::algorithm::replace_all (body, "$SCREENS", screens.substr (0, screens.length() - 2));
Emailer email (config->kdm_from(), i.cinema->emails, subject, body);
Emailer email (config->kdm_from(), i.cinema->emails, subject, body);