Don't report .tmp files as valid thumbs.
authorCarl Hetherington <cth@carlh.net>
Sun, 21 Oct 2012 17:04:13 +0000 (18:04 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 21 Oct 2012 17:04:13 +0000 (18:04 +0100)
src/lib/film.cc

index 74e5d0bb234380422f90bb8d4feecfc437e187ca..aa0bfa21192cfb6d1c87c2bf858198c1b283072c 100644 (file)
@@ -260,7 +260,7 @@ Film::examine_content_post_gui ()
 
        string const tdir = dir ("thumbs");
        vector<int> thumbs;
-       
+
        for (filesystem::directory_iterator i = filesystem::directory_iterator (tdir); i != filesystem::directory_iterator(); ++i) {
 
                /* Aah, the sweet smell of progress */
@@ -271,7 +271,8 @@ Film::examine_content_post_gui ()
 #endif
                
                size_t const d = l.find (".png");
-               if (d != string::npos) {
+               size_t const t = l.find (".tmp");
+               if (d != string::npos && t == string::npos) {
                        thumbs.push_back (atoi (l.substr (0, d).c_str()));
                }
        }