From: Calin Crisan Date: Fri, 18 Mar 2016 08:47:25 +0000 (+0200) Subject: delete the thumb file when deleting one single movie X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=4c8dbb44e8d91f604ac822c1fe03174d972e6426;p=motioneye-debian delete the thumb file when deleting one single movie --- diff --git a/motioneye/mediafiles.py b/motioneye/mediafiles.py index c47a6d8..bafc62d 100644 --- a/motioneye/mediafiles.py +++ b/motioneye/mediafiles.py @@ -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)