diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-18 22:27:32 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-18 22:27:32 +0100 |
commit | 23c628363aa0a7f44b5e869551b2bbcacad3e96c (patch) | |
tree | ad305ef49bffdcbfab46e4fe47968ab677d4d747 /pyload/database/FileDatabase.py | |
parent | decrypt single packages into the current one (diff) | |
download | pyload-23c628363aa0a7f44b5e869551b2bbcacad3e96c.tar.xz |
basically working multi-user mode
Diffstat (limited to 'pyload/database/FileDatabase.py')
-rw-r--r-- | pyload/database/FileDatabase.py | 12 |
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) |