From 323146ee516476d76de5b56fdbc08747bf832825 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 4 Sep 2025 21:57:49 +0200 Subject: Revert "Remove timing selection from DKDM dialog." (#3017). This reverts commit ce01ccc1aa871d299ad96683055c4e06a355efb9. Turns out there are quite a few people and pieces of software who care about this. --- src/lib/dkdm_recipient.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/lib/dkdm_recipient.cc') diff --git a/src/lib/dkdm_recipient.cc b/src/lib/dkdm_recipient.cc index 6e86d7b93..8b44bb25f 100644 --- a/src/lib/dkdm_recipient.cc +++ b/src/lib/dkdm_recipient.cc @@ -24,6 +24,7 @@ #include "dkdm_recipient.h" #include "film.h" #include "kdm_with_metadata.h" +#include using std::make_shared; @@ -36,7 +37,9 @@ KDMWithMetadataPtr kdm_for_dkdm_recipient ( shared_ptr film, boost::filesystem::path cpl, - DKDMRecipient const& recipient + DKDMRecipient const& recipient, + boost::posix_time::ptime valid_from, + boost::posix_time::ptime valid_to ) { if (!recipient.recipient()) { @@ -48,17 +51,17 @@ kdm_for_dkdm_recipient ( throw InvalidSignerError(); } - auto start = signer->leaf().not_before(); - start.add_days(1); - auto end = signer->leaf().not_after(); - end.add_days(-1); + auto const valid_from_local = dcp::LocalTime(valid_from); + auto const valid_to_local = dcp::LocalTime(valid_to); - auto const decrypted_kdm = film->make_kdm(cpl, start, end); + auto const decrypted_kdm = film->make_kdm(cpl, valid_from_local, valid_to_local); auto const kdm = decrypted_kdm.encrypt(signer, recipient.recipient().get(), {}, dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0); dcp::NameFormat::Map name_values; name_values['f'] = kdm.content_title_text(); name_values['r'] = recipient.name; + name_values['b'] = valid_from_local.date() + " " + valid_from_local.time_of_day(true, false); + name_values['e'] = valid_to_local.date() + " " + valid_to_local.time_of_day(true, false); name_values['i'] = kdm.cpl_id(); return make_shared(name_values, CinemaID(0), recipient.emails, kdm); -- cgit v1.2.3