Extract common code out into kdm_for_screen()
[dcpomatic.git] / src / lib / types.cc
index 19e5da6ec78aa8c39c099f06d47f206cb3ab746d..9519b309729db5ed323ccdd7bcd8ef0ad93a9d1d 100644 (file)
@@ -35,6 +35,7 @@
 using std::max;
 using std::min;
 using std::string;
+using std::list;
 using boost::shared_ptr;
 using dcp::raw_convert;
 
@@ -193,7 +194,11 @@ CPLSummary::CPLSummary (boost::filesystem::path p)
        : dcp_directory (p.leaf().string())
 {
        dcp::DCP dcp (p);
-       dcp.read ();
+       list<dcp::VerificationNote> notes;
+       dcp.read (&notes);
+       if (!notes.empty()) {
+               throw dcp::ReadError(dcp::note_to_string(notes.front()));
+       }
 
        cpl_id = dcp.cpls().front()->id();
        cpl_annotation_text = dcp.cpls().front()->annotation_text();