]> www.vanbest.org Git - motioneye-debian/commitdiff
delete the thumb file when deleting one single movie
authorCalin Crisan <ccrisan@gmail.com>
Fri, 18 Mar 2016 08:47:25 +0000 (10:47 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Fri, 18 Mar 2016 08:47:25 +0000 (10:47 +0200)
motioneye/mediafiles.py

index c47a6d8c8c2518a605a9ac586ed9a6be4bfbd265..bafc62df0e31a435175320d43a85565934601076 100644 (file)
@@ -708,6 +708,13 @@ def del_media_content(camera_config, path, media_type):
     try:
         # remove the file itself
         os.remove(full_path)
+        
+        # remove the thumb file
+        try:
+            os.remove(full_path + '.thumb')
+        
+        except:
+            pass
 
         # remove the parent directories if empty or contains only thumb files
         dir_path = os.path.dirname(full_path)