From 8c142b1b091aad180a61893630948913c814c3dd Mon Sep 17 00:00:00 2001
From: Calin Crisan <ccrisan@gmail.com>
Date: Sat, 9 Jan 2016 11:18:01 +0200
Subject: [PATCH] ignore hidden dirs when collecting media files

---
 motioneye/mediafiles.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/motioneye/mediafiles.py b/motioneye/mediafiles.py
index 138cb07..fd0a4df 100644
--- a/motioneye/mediafiles.py
+++ b/motioneye/mediafiles.py
@@ -80,6 +80,9 @@ def _list_media_files(dir, exts, prefix=None):
 
     else:    
         for root, dirs, files in os.walk(dir):  # @UnusedVariable # TODO os.walk can be rewritten to return stat info
+            if os.path.basename(root).startswith('.'): # ignore hidden dirs
+                continue
+
             for name in files:
                 if name == 'lastsnap.jpg' or name.startswith('.'): # ignore the lastsnap.jpg and hidden files
                     continue
-- 
2.39.5