summaryrefslogtreecommitdiff
path: root/src/verify.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-02-02 01:03:27 +0100
committerCarl Hetherington <cth@carlh.net>2023-02-02 01:03:27 +0100
commitb424b9d40a472c00d2ddbe2218375dcbd3d947fc (patch)
tree21e5f3858868b18d6008a3ba5b5169f3218b5381 /src/verify.cc
parentb1464249c7b403a66ca63f403c80c39f1af63e65 (diff)
Check IssueDate for Deluxe complaint.
Diffstat (limited to 'src/verify.cc')
-rw-r--r--src/verify.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 8ea9ae97..61c41743 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -79,6 +79,7 @@
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <map>
+#include <regex>
#include <set>
#include <vector>
@@ -726,6 +727,17 @@ verify_smpte_subtitle_asset (
} else {
notes.push_back ({VerificationNote::Type::WARNING, VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED});
}
+
+ if (asset->raw_xml()) {
+ /* Deluxe require this in their QC even if it seems never to be mentioned in any standard */
+ cxml::Document doc("SubtitleReel");
+ doc.read_string(*asset->raw_xml());
+ auto issue_date = doc.string_child("IssueDate");
+ std::regex reg("^\\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d$");
+ if (!std::regex_match(issue_date, reg)) {
+ notes.push_back({VerificationNote::Type::WARNING, VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE, issue_date});
+ }
+ }
}
@@ -1955,6 +1967,8 @@ dcp::note_to_string (VerificationNote note)
return String::compose("The ASSETMAP %1 has more than one asset with the same ID", note.note().get());
case VerificationNote::Code::MISSING_SUBTITLE:
return String::compose("The subtitle asset %1 has no subtitles", note.note().get());
+ case VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE:
+ return String::compose("<IssueDate> has an invalid value: %1", note.note().get());
}
return "";