summaryrefslogtreecommitdiffstats
path: root/module/FileDatabase.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/FileDatabase.py')
-rw-r--r--module/FileDatabase.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/module/FileDatabase.py b/module/FileDatabase.py
index a71336e07..cbb72b416 100644
--- a/module/FileDatabase.py
+++ b/module/FileDatabase.py
@@ -189,6 +189,7 @@ class FileHandler:
"""deletes links"""
f = self.getFile(id)
+ pid = f.packageid
if not f:
return None
@@ -205,6 +206,10 @@ class FileHandler:
self.db.deleteLink(f)
self.core.pullManager.addEvent(e)
+
+ p = self.getPackage(pid)
+ if len(p.getChildren()) == 0:
+ p.delete()
#----------------------------------------------------------------------
def releaseLink(self, id):