Fix typo in log message.
[dcpomatic.git] / src / lib / dkdm_recipient.cc
index 22da53f3babb5b13c0be0d3e211e4b407a048509..ff19aa265b050e05d7c267cebe67dd9eebdcb66d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "dkdm_recipient.h"
-#include "kdm_with_metadata.h"
 #include "film.h"
+#include "kdm_with_metadata.h"
 #include <dcp/raw_convert.h>
 
 
+using std::make_shared;
+using std::shared_ptr;
 using std::string;
 using std::vector;
-using std::shared_ptr;
 using dcp::raw_convert;
 
 
@@ -66,29 +68,29 @@ kdm_for_dkdm_recipient (
        )
 {
        if (!recipient->recipient) {
-               return KDMWithMetadataPtr();
+               return {};
        }
 
        dcp::LocalTime const begin(valid_from, recipient->utc_offset_hour, recipient->utc_offset_minute);
        dcp::LocalTime const end  (valid_to,   recipient->utc_offset_hour, recipient->utc_offset_minute);
 
-       dcp::EncryptedKDM const kdm = film->make_kdm (
+       auto const kdm = film->make_kdm (
                        recipient->recipient.get(),
                        vector<string>(),
                        cpl,
                        begin,
                        end,
-                       dcp::MODIFIED_TRANSITIONAL_1,
+                       dcp::Formulation::MODIFIED_TRANSITIONAL_1,
                        true,
                        0
                        );
 
        dcp::NameFormat::Map name_values;
-       name_values['f'] = film->name();
+       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();
 
-       return KDMWithMetadataPtr(new KDMWithMetadata(name_values, 0, recipient->emails, kdm));
+       return make_shared<KDMWithMetadata>(name_values, nullptr, recipient->emails, kdm);
 }