X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fkdm_cli.cc;h=0ec648e0489d1a9eb88db033fbfbe14e9d35731d;hb=2fd641547b5fb795fc17e98e47f489fa82e8ff42;hp=3815b3d65ea475651aef31e67b921048b3ce125a;hpb=e457efe73b651538ca42a04d7e8c365ce5f6731e;p=dcpomatic.git diff --git a/src/lib/kdm_cli.cc b/src/lib/kdm_cli.cc index 3815b3d65..0ec648e04 100644 --- a/src/lib/kdm_cli.cc +++ b/src/lib/kdm_cli.cc @@ -354,8 +354,11 @@ from_dkdm ( 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, @@ -369,14 +372,14 @@ from_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(name_values, i->cinema.get(), i->cinema->emails, kdm)); + kdms.push_back (make_shared(name_values, i->cinema.get(), i->cinema ? i->cinema->emails : list(), kdm)); } write_files (kdms, zip, output, container_name_format, filename_format, verbose, out); if (email) { @@ -414,7 +417,7 @@ optional kdm_cli (int argc, char* argv[], std::function 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 cinema_name; @@ -537,7 +540,7 @@ try { /* Make a new screen and add it to the current cinema */ dcp::CertificateChain chain (dcp::file_to_string(optarg)); - auto screen = make_shared(screen_description, "", chain.leaf(), vector()); + auto screen = std::make_shared(screen_description, "", chain.leaf(), boost::none, vector()); if (cinema) { cinema->add_screen (screen); } @@ -596,9 +599,6 @@ try 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()))); }