diff options
author | Martin Herkt <lachs0r@srsfckn.biz> | 2017-11-08 11:29:02 +0100 |
---|---|---|
committer | Martin Herkt <lachs0r@srsfckn.biz> | 2017-11-08 11:29:02 +0100 |
commit | 0b288d9a94df5662d87fa23dc41f04cf5323aeb0 (patch) | |
tree | 08b19a8e687728ee24549d3715f27a37bdda6169 /fhost.py | |
parent | 5608c72e03319d39c25fd3ce6403f52f649d47d4 (diff) |
Add command to delete all files uploaded by address
Diffstat (limited to 'fhost.py')
-rwxr-xr-x | fhost.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -476,6 +476,17 @@ def queryaddr(a, nsfw=False, removed=False): for f in res: f.pprint() +@manager.command +def deladdr(a): + res = File.query.filter_by(addr=a).filter(File.removed != True) + + for f in res: + if os.path.exists(getpath(f.sha256)): + os.remove(getpath(f.sha256)) + f.removed = True + + db.session.commit() + def nsfw_detect(f): try: open(f["path"], 'r').close() |