X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_kdm_cli.cc;h=4dd252a9ecd07da123e096f3f2052b923695dc7b;hb=86977b9303a63f1c4da5e3aa992fec0a6538e28d;hp=bd4c4e62324fd54b8e6e0ef053220b45e31d8989;hpb=7bc2134d658778e04f1756c255e604b4ab5a5831;p=dcpomatic.git diff --git a/src/tools/dcpomatic_kdm_cli.cc b/src/tools/dcpomatic_kdm_cli.cc index bd4c4e623..4dd252a9e 100644 --- a/src/tools/dcpomatic_kdm_cli.cc +++ b/src/tools/dcpomatic_kdm_cli.cc @@ -68,8 +68,9 @@ help () " -t, --valid-to valid to time (in local time zone of the cinema) (e.g. \"2014-09-28 01:41:51\")\n" " -d, --valid-duration valid duration (e.g. \"1 day\", \"4 hours\", \"2 weeks\")\n" " -F, --formulation modified-transitional-1, multiple-modified-transitional-1, dci-any or dci-specific [default modified-transitional-1]\n" - " -a, --disable-forensic-marking-picture disable forensic marking of pictures essences\n" + " -p, --disable-forensic-marking-picture disable forensic marking of pictures essences\n" " -a, --disable-forensic-marking-audio disable forensic marking of audio essences (optionally above a given channel, e.g 12)\n" + " -e, --email email KDMs to cinemas\n" " -z, --zip ZIP each cinema's KDMs into its own file\n" " -v, --verbose be verbose\n" " -c, --cinema specify a cinema, either by name or email address\n" @@ -210,6 +211,7 @@ from_film ( dcp::Formulation formulation, bool disable_forensic_marking_picture, optional disable_forensic_marking_audio, + bool email, bool zip ) { @@ -244,6 +246,9 @@ from_film ( } } write_files (kdms, zip, output, container_name_format, filename_format, verbose); + if (email) { + send_emails ({kdms}, container_name_format, filename_format, film->dcp_name()); + } } catch (FileError& e) { cerr << program_name << ": " << e.what() << " (" << e.file().string() << ")\n"; exit (EXIT_FAILURE); @@ -335,6 +340,7 @@ from_dkdm ( dcp::Formulation formulation, bool disable_forensic_marking_picture, optional disable_forensic_marking_audio, + bool email, bool zip ) { @@ -372,12 +378,18 @@ from_dkdm ( kdms.push_back (make_shared(name_values, i->cinema.get(), i->cinema->emails, kdm)); } write_files (kdms, zip, output, container_name_format, filename_format, verbose); + if (email) { + send_emails ({kdms}, container_name_format, filename_format, dkdm.annotation_text().get_value_or("")); + } } catch (FileError& e) { cerr << program_name << ": " << e.what() << " (" << e.file().string() << ")\n"; exit (EXIT_FAILURE); } catch (KDMError& e) { cerr << program_name << ": " << e.what() << "\n"; exit (EXIT_FAILURE); + } catch (NetworkError& e) { + cerr << program_name << ": " << e.what() << "\n"; + exit (EXIT_FAILURE); } } @@ -427,6 +439,7 @@ int main (int argc, char* argv[]) dcp::Formulation formulation = dcp::Formulation::MODIFIED_TRANSITIONAL_1; bool disable_forensic_marking_picture = false; optional disable_forensic_marking_audio; + bool email = false; program_name = argv[0]; @@ -443,6 +456,7 @@ int main (int argc, char* argv[]) { "formulation", required_argument, 0, 'F' }, { "disable-forensic-marking-picture", no_argument, 0, 'p' }, { "disable-forensic-marking-audio", optional_argument, 0, 'a' }, + { "email", no_argument, 0, 'e' }, { "zip", no_argument, 0, 'z' }, { "verbose", no_argument, 0, 'v' }, { "cinema", required_argument, 0, 'c' }, @@ -454,7 +468,7 @@ int main (int argc, char* argv[]) { 0, 0, 0, 0 } }; - int c = getopt_long (argc, argv, "ho:K:Z:f:t:d:F:pa::zvc:S:C:T:BD", long_options, &option_index); + int c = getopt_long (argc, argv, "ho:K:Z:f:t:d:F:pae::zvc:S:C:T:BD", long_options, &option_index); if (c == -1) { break; @@ -506,6 +520,9 @@ int main (int argc, char* argv[]) disable_forensic_marking_audio = atoi (optarg); } break; + case 'e': + email = true; + break; case 'z': zip = true; break; @@ -568,7 +585,6 @@ int main (int argc, char* argv[]) if (!valid_from) { error ("you must specify --valid-from"); - exit (EXIT_FAILURE); } if (optind >= argc) { @@ -609,6 +625,7 @@ int main (int argc, char* argv[]) formulation, disable_forensic_marking_picture, disable_forensic_marking_audio, + email, zip ); } else { @@ -634,6 +651,7 @@ int main (int argc, char* argv[]) formulation, disable_forensic_marking_picture, disable_forensic_marking_audio, + email, zip ); }