summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2016-04-03 17:03:39 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2016-04-03 17:03:39 +0200
commit57fa40103fb866200a254efb9754b4d5d54cd7f9 (patch)
tree55e74c624177971edd06b5579d41639771aae5f9
parent55f48726d56a22eb409df0c1a091839e92dd4525 (diff)
Delete thumbnails when deleting files.
-rwxr-xr-xfbin.py3
1 files changed, 3 insertions, 0 deletions
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: