diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-09-28 12:29:56 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-09-28 12:29:56 +0100 |
| commit | 84b50d26c24222ad3f936590f5d706e58ac24922 (patch) | |
| tree | 89021447490af15ee7ae66c915eaba190325fc21 /src | |
| parent | 2659df852059c399804aeea8092e91199e2cd322 (diff) | |
Don't take any notice of ._* files when deciding whether a folder contains images or a DCP.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/content_factory.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index 5b6d71641..3aa8ca9d3 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -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) { |
