Fix problems when loading old projects with the new subtitle font code (#2271).
[dcpomatic.git] / src / lib / check_content_job.cc
index a789ed9e0118bacbbfe9011b714105e16fbfd2e3..2b6e25da8b1570fb9be83ae3ce1707071391db25 100644 (file)
 #include "examine_content_job.h"
 #include "film.h"
 #include "job_manager.h"
+#include "string_text_file_content.h"
 #include <iostream>
 
 #include "i18n.h"
 
 
 using std::cout;
+using std::dynamic_pointer_cast;
 using std::make_shared;
 using std::shared_ptr;
 using std::string;
@@ -74,6 +76,14 @@ CheckContentJob::run ()
                set_message (_("Some files have been changed since they were added to the project.\n\nThese files will now be re-examined, so you may need to check their settings."));
        }
 
+       if (_film->last_written_by_earlier_than(2, 16, 14)) {
+               for (auto c: content) {
+                       if (auto stf = dynamic_pointer_cast<StringTextFileContent>(c)) {
+                               stf->check_font_ids();
+                       }
+               }
+       }
+
        set_progress (1);
        set_state (FINISHED_OK);
 }