summaryrefslogtreecommitdiffstats
path: root/pyload/database/FileDatabase.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-01-18 22:27:32 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-01-18 22:27:32 +0100
commit23c628363aa0a7f44b5e869551b2bbcacad3e96c (patch)
treead305ef49bffdcbfab46e4fe47968ab677d4d747 /pyload/database/FileDatabase.py
parentdecrypt single packages into the current one (diff)
downloadpyload-23c628363aa0a7f44b5e869551b2bbcacad3e96c.tar.xz
basically working multi-user mode
Diffstat (limited to 'pyload/database/FileDatabase.py')
-rw-r--r--pyload/database/FileDatabase.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pyload/database/FileDatabase.py b/pyload/database/FileDatabase.py
index e6e051a92..3bd12ca80 100644
--- a/pyload/database/FileDatabase.py
+++ b/pyload/database/FileDatabase.py
@@ -38,8 +38,8 @@ class FileMethods(DatabaseMethods):
self.c.execute("SELECT COUNT(*), SUM(f.size) FROM files f WHERE dlstatus != 0")
else:
self.c.execute(
- "SELECT COUNT(*), SUM(f.size) FROM files f, packages p WHERE f.package = p.pid AND dlstatus != 0",
- user)
+ "SELECT COUNT(*), SUM(f.size) FROM files f WHERE f.owner=? AND dlstatus != 0",
+ (user,))
r = self.c.fetchone()
# sum is None when no elements are added
@@ -54,8 +54,8 @@ class FileMethods(DatabaseMethods):
self.c.execute("SELECT COUNT(*), SUM(f.size) FROM files f WHERE dlstatus NOT IN (0,5,6)")
else:
self.c.execute(
- "SELECT COUNT(*), SUM(f.size) FROM files f, package p WHERE f.package = p.pid AND p.owner=? AND dlstatus NOT IN (0,5,6)",
- user)
+ "SELECT COUNT(*), SUM(f.size) FROM files f WHERE f.owner=? AND dlstatus NOT IN (0,5,6)",
+ (user,))
r = self.c.fetchone()
return (r[0], r[1] if r[1] is not None else 0) if r else (0, 0)
@@ -75,8 +75,8 @@ class FileMethods(DatabaseMethods):
self.c.execute("SELECT COUNT(*), SUM(size) FROM files WHERE dlstatus IN (2,3,8,9,10)")
else:
self.c.execute(
- "SELECT COUNT(*), SUM(f.size) FROM files f, packages p WHERE f.package = p.pid AND dlstatus IN (2,3,8,9,10)",
- user)
+ "SELECT COUNT(*), SUM(f.size) FROM files f WHERE f.owner=? AND dlstatus IN (2,3,8,9,10)",
+ (user,))
r = self.c.fetchone()
return (r[0], r[1] if r[1] is not None else 0) if r else (0, 0)