From 57fa40103fb866200a254efb9754b4d5d54cd7f9 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 3 Apr 2016 17:03:39 +0200 Subject: Delete thumbnails when deleting files. --- fbin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fbin.py b/fbin.py index a718ac9..e1c1853 100755 --- a/fbin.py +++ b/fbin.py @@ -140,6 +140,9 @@ class Application(object): session.delete(file) session.commit() os.unlink(file.get_path()) + thumbfile = os.path.join(settings.thumb_directory, file.hash + '.jpg') + if os.path.exists(thumbfile): + os.unlink(thumbfile) except: raise finally: -- cgit v1.2.3