X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fkdm_cli.cc;h=4c1a55d7d3f19423148d6797040fdcbb182f2c22;hb=b1e22dff981fb86ae04b12bb5a064e61030793a8;hp=8086fc4b7ea87e20fc39ba734dedda204a8db8ad;hpb=1871ff804558499e85100815dce103d5b31a95ae;p=dcpomatic.git diff --git a/src/lib/kdm_cli.cc b/src/lib/kdm_cli.cc index 8086fc4b7..4c1a55d7d 100644 --- a/src/lib/kdm_cli.cc +++ b/src/lib/kdm_cli.cc @@ -250,7 +250,7 @@ from_film ( } write_files (kdms, zip, output, container_name_format, filename_format, verbose, out); if (email) { - send_emails ({kdms}, container_name_format, filename_format, film->dcp_name()); + send_emails ({kdms}, container_name_format, filename_format, film->dcp_name(), {}); } } catch (FileError& e) { throw KDMCLIError (String::compose("%1 (%2)", e.what(), e.file().string())); @@ -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,18 +372,18 @@ 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['f'] = kdm.content_title_text(); 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) { - send_emails ({kdms}, container_name_format, filename_format, dkdm.annotation_text().get_value_or("")); + send_emails ({kdms}, container_name_format, filename_format, dkdm.annotation_text().get_value_or(""), {}); } } catch (FileError& e) { throw KDMCLIError (String::compose("%1 (%2)", e.what(), e.file().string())); @@ -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()))); }