From 3c1236c5ec9d2ab45a435184315c31d3cfb35cba Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 1 Aug 2010 17:44:17 +0200 Subject: job fix --- module/FileDatabase.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/FileDatabase.py b/module/FileDatabase.py index e371754e6..5085bc16a 100644 --- a/module/FileDatabase.py +++ b/module/FileDatabase.py @@ -522,8 +522,13 @@ class FileDatabaseBackend(Thread): @queue def getJob(self, occ): + if len(occ) == 1: + occ = "(%)" % str(occ) + else: + occ = str(occ) + """return pyfile instance, which is suitable for download and dont use a occupied plugin""" - self.c.execute("SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=1 AND l.plugin NOT IN %s AND l.status IN (2,3,6) LIMIT 5" % str(occ)) # very bad! + self.c.execute("SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=1 AND l.plugin NOT IN %s AND l.status IN (2,3,6) LIMIT 5" % occ) # very bad! return [x[0] for x in self.c ] -- cgit v1.2.3