diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-01 18:40:51 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-01 18:40:51 +0200 |
commit | 9f6430ca71dedf9ac0f1ad527a3c3ae2bd1f351a (patch) | |
tree | f68d03873b5d7612ef3b90af5bcbeab82e57ff8e /module/FileDatabase.py | |
parent | Netload.In fix (diff) | |
download | pyload-9f6430ca71dedf9ac0f1ad527a3c3ae2bd1f351a.tar.xz |
ocr + db fix
Diffstat (limited to 'module/FileDatabase.py')
-rw-r--r-- | module/FileDatabase.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/module/FileDatabase.py b/module/FileDatabase.py index 5085bc16a..b52acd4d0 100644 --- a/module/FileDatabase.py +++ b/module/FileDatabase.py @@ -522,13 +522,19 @@ 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" % occ) # very bad! + + cmd = "(" + i = 0 + for item in occ: + if i != 0: cmd += ", " + cmd += "'%s'" % item + + cmd += ")" + + cmd = "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" % cmd + + self.c.execute(cmd) # very bad! return [x[0] for x in self.c ] |