diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-17 01:31:38 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-22 14:34:25 +0100 |
| commit | 5e10a6f047d12f1e2e3d0e2f8ee30f93897a2227 (patch) | |
| tree | c3daccbbf2291d6330df2c2f6d99bf34fcb2e288 /src/lib/cinema_list.cc | |
| parent | c29ba2526337b486d4a3b1a1468513a22293bc87 (diff) | |
Allow KDMRecipient and hence Screen to convert certs to dcp::Certificate lazily.
This is pretty slow (as it runs the certificate through OpenSSL) and we
don't need to do it for every certificate in a database when we load the
database.
Diffstat (limited to 'src/lib/cinema_list.cc')
| -rw-r--r-- | src/lib/cinema_list.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/cinema_list.cc b/src/lib/cinema_list.cc index f59a8f4f8..01824ca54 100644 --- a/src/lib/cinema_list.cc +++ b/src/lib/cinema_list.cc @@ -309,7 +309,7 @@ CinemaList::add_screen(CinemaID cinema_id, dcpomatic::Screen const& screen) add_screen.bind_int64(1, cinema_id.get()); add_screen.bind_text(2, screen.name); add_screen.bind_text(3, screen.notes); - add_screen.bind_text(4, screen.recipient->certificate(true)); + add_screen.bind_text(4, screen.recipient()->certificate(true)); add_screen.bind_text(5, screen.recipient_file.get_value_or("")); add_screen.execute(); @@ -332,7 +332,7 @@ dcpomatic::Screen CinemaList::screen_from_result(SQLiteStatement& statement, ScreenID screen_id) const { auto certificate_string = statement.column_text(4); - optional<dcp::Certificate> certificate = certificate_string.empty() ? optional<dcp::Certificate>() : dcp::Certificate(certificate_string); + optional<string> certificate = certificate_string.empty() ? optional<string>() : certificate_string; auto recipient_file_string = statement.column_text(5); optional<string> recipient_file = recipient_file_string.empty() ? optional<string>() : recipient_file_string; @@ -429,7 +429,7 @@ CinemaList::update_screen(CinemaID cinema_id, ScreenID screen_id, dcpomatic::Scr statement.bind_int64(1, cinema_id.get()); statement.bind_text(2, screen.name); statement.bind_text(3, screen.notes); - statement.bind_text(4, screen.recipient->certificate(true)); + statement.bind_text(4, screen.recipient()->certificate(true)); statement.bind_text(5, screen.recipient_file.get_value_or("")); statement.bind_int64(6, screen_id.get()); |
