Basic support for trusted device lists in KDMs (#750).
[dcpomatic.git] / src / lib / content_factory.cc
index 5b6d71641929023aa3fd06fe0f43f99e9ac29ae3..3aa8ca9d31eb16ef16dc34ce776f43b198a50ad8 100644 (file)
@@ -30,6 +30,7 @@
 #include "util.h"
 #include <libcxml/cxml.h>
 #include <dcp/smpte_subtitle_asset.h>
+#include <boost/algorithm/string.hpp>
 
 using std::string;
 using std::list;
@@ -88,10 +89,18 @@ content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
 
                bool is_dcp = false;
                int read = 0;
-               for (boost::filesystem::directory_iterator i(path); i != boost::filesystem::directory_iterator() && read < 10; ++i, ++read) {
+               for (boost::filesystem::directory_iterator i(path); i != boost::filesystem::directory_iterator() && read < 10; ++i) {
+
+                       if (boost::starts_with (i->path().leaf().string(), "._")) {
+                               /* We ignore these files */
+                               continue;
+                       }
+
                        if (!boost::filesystem::is_regular_file (i->path()) || !valid_image_file (i->path())) {
                                is_dcp = true;
                        }
+
+                       ++read;
                }
 
                if (is_dcp) {