Fix problems with loading projects with captions / subs.
authorCarl Hetherington <cth@carlh.net>
Wed, 25 Jul 2018 12:54:10 +0000 (13:54 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 25 Jul 2018 12:54:10 +0000 (13:54 +0100)
src/lib/text_content.cc
src/lib/types.cc

index 761ffc6b729dffce64e23397bc48f5c5b7f5dcfc..7c3c27d4585c25ff1b0789f4fe0500ce29d90c60 100644 (file)
@@ -73,7 +73,7 @@ TextContent::TextContent (Content* parent, TextType type, TextType original_type
 
 }
 
-/** @return TextContents from node or <Caption> nodes under node (according to version).
+/** @return TextContents from node or <Text> nodes under node (according to version).
  *  The list could be empty if no TextContents are found.
  */
 list<shared_ptr<TextContent> >
@@ -99,12 +99,12 @@ TextContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version)
                return c;
        }
 
-       if (!node->optional_node_child("Caption")) {
+       if (!node->optional_node_child("Text")) {
                return list<shared_ptr<TextContent> >();
        }
 
        list<shared_ptr<TextContent> > c;
-       BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Caption")) {
+       BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Text")) {
                c.push_back (shared_ptr<TextContent> (new TextContent (parent, i, version)));
        }
        return c;
index b193ac9cf90400699151495890ae5d05ff2a5fb2..898abeca4c2ed531bbff7da624fa6683cd5af3dc 100644 (file)
@@ -100,7 +100,7 @@ string_to_text_type (string s)
                return TEXT_UNKNOWN;
        } else if (s == "open-subtitle") {
                return TEXT_OPEN_SUBTITLE;
-       } else if (s == "closed") {
+       } else if (s == "closed-caption") {
                return TEXT_CLOSED_CAPTION;
        } else {
                throw MetadataError (String::compose ("Unknown text type %1", s));