From 84aa569a2ec5d5fbe61270ef11e539d62ab1374e Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 17 Jun 2011 15:44:50 +0200 Subject: skip files across packages --- module/database/FileDatabase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/database/FileDatabase.py') diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py index 7ecf81576..6ea7d1104 100644 --- a/module/database/FileDatabase.py +++ b/module/database/FileDatabase.py @@ -816,9 +816,9 @@ class FileMethods(): @style.queue - def findDuplicates(self, id, pid, filename): + def findDuplicates(self, id, folder, filename): """ checks if filename exists with different id and same package """ - self.c.execute("SELECT plugin FROM links where id!=? AND status=0 AND package=? AND name=?", (id, pid, filename)) + self.c.execute("SELECT l.plugin FROM links as l INNER JOIN packages as p ON l.package=p.id AND p.folder=? WHERE l.id!=? AND l.status=0 AND l.name=?", (folder, id, filename)) return self.c.fetchone() DatabaseBackend.registerSub(FileMethods) -- cgit v1.2.3