From 5d0807959de238399fb49de6d0b29b5f4e4b37f1 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 26 May 2011 20:20:21 +0200 Subject: mirror detection/handling --- module/database/FileDatabase.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'module/database/FileDatabase.py') diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py index 99812d2c9..3ba43f881 100644 --- a/module/database/FileDatabase.py +++ b/module/database/FileDatabase.py @@ -814,6 +814,13 @@ class FileMethods(): def restartFailed(self): self.c.execute("UPDATE links SET status=3,error='' WHERE status IN (8, 9)") + + @style.queue + def findDuplicates(self, id, pid, 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)) + return self.c.fetchone() + DatabaseBackend.registerSub(FileMethods) if __name__ == "__main__": -- cgit v1.2.3