Correct version number when deciding whether or not to fix subtitle IDs.
[dcpomatic.git] / src / lib / check_content_job.cc
index a789ed9e0118bacbbfe9011b714105e16fbfd2e3..f37890abfe39c783af4635012276fdb5be2c5ccb 100644 (file)
 
 #include "check_content_job.h"
 #include "content.h"
+#include "dcp_content.h"
 #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;
@@ -67,6 +70,16 @@ CheckContentJob::run ()
        std::vector<shared_ptr<Content>> changed;
        std::copy_if (content.begin(), content.end(), std::back_inserter(changed), [](shared_ptr<Content> c) { return c->changed(); });
 
+       if (_film->last_written_by_earlier_than(2, 16, 15)) {
+               for (auto c: content) {
+                       if (auto stf = dynamic_pointer_cast<StringTextFileContent>(c)) {
+                               stf->check_font_ids();
+                       } else if (auto dcp = dynamic_pointer_cast<DCPContent>(c)) {
+                               dcp->check_font_ids();
+                       }
+               }
+       }
+
        if (!changed.empty()) {
                for (auto i: changed) {
                        JobManager::instance()->add(make_shared<ExamineContentJob>(_film, i));