continue;
}
- dcp::LocalTime begin(valid_from, i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute());
- dcp::LocalTime end(valid_to, i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute());
+ int const offset_hour = i->cinema ? i->cinema->utc_offset_hour() : 0;
+ int const offset_minute = i->cinema ? i->cinema->utc_offset_minute() : 0;
+
+ dcp::LocalTime begin(valid_from, offset_hour, offset_minute);
+ dcp::LocalTime end(valid_to, offset_hour, offset_minute);
auto const kdm = kdm_from_dkdm(
dkdm,
);
dcp::NameFormat::Map name_values;
- name_values['c'] = i->cinema->name;
+ name_values['c'] = i->cinema ? i->cinema->name : "";
name_values['s'] = i->name;
name_values['f'] = dkdm.annotation_text().get_value_or("");
name_values['b'] = begin.date() + " " + begin.time_of_day(true, false);
name_values['e'] = end.date() + " " + end.time_of_day(true, false);
name_values['i'] = kdm.cpl_id();
- kdms.push_back (make_shared<KDMWithMetadata>(name_values, i->cinema.get(), i->cinema->emails, kdm));
+ kdms.push_back (make_shared<KDMWithMetadata>(name_values, i->cinema.get(), i->cinema ? i->cinema->emails : list<string>(), kdm));
}
write_files (kdms, zip, output, container_name_format, filename_format, verbose, out);
if (email) {
kdm_cli (int argc, char* argv[], std::function<void (string)> out)
try
{
- boost::filesystem::path output = ".";
+ boost::filesystem::path output = boost::filesystem::current_path();
auto container_name_format = Config::instance()->kdm_container_name_format();
auto filename_format = Config::instance()->kdm_filename_format();
optional<string> cinema_name;
{
/* Make a new screen and add it to the current cinema */
dcp::CertificateChain chain (dcp::file_to_string(optarg));
- auto screen = make_shared<Screen>(screen_description, "", chain.leaf(), vector<TrustedDevice>());
+ auto screen = std::make_shared<Screen>(screen_description, "", chain.leaf(), boost::none, vector<TrustedDevice>());
if (cinema) {
cinema->add_screen (screen);
}
valid_to = valid_from.get() + duration_from_string (*duration_string);
}
- dcpomatic_setup_path_encoding ();
- dcpomatic_setup ();
-
if (verbose) {
out (String::compose("Making KDMs valid from %1 to %2", boost::posix_time::to_simple_string(valid_from.get()), boost::posix_time::to_simple_string(valid_to.get())));
}