summaryrefslogtreecommitdiffstats
path: root/pyload
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-08-10 19:51:04 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-08-10 19:51:04 +0200
commit4f85ba108b5dfb949816b69ef3fd837cb59cb9d4 (patch)
tree2e784c198303b1ae05bb935986586141ea3adf4a /pyload
parentparse string from template files, added some translations for webu (diff)
downloadpyload-4f85ba108b5dfb949816b69ef3fd837cb59cb9d4.tar.xz
fix updateFileInfo and account selection
Diffstat (limited to 'pyload')
-rw-r--r--pyload/AccountManager.py3
-rw-r--r--pyload/database/FileDatabase.py4
2 files changed, 4 insertions, 3 deletions
diff --git a/pyload/AccountManager.py b/pyload/AccountManager.py
index 1c409b754..814c08615 100644
--- a/pyload/AccountManager.py
+++ b/pyload/AccountManager.py
@@ -128,7 +128,8 @@ class AccountManager:
""" Determines suitable plugins and select one """
if plugin in self.accounts:
uid = user.true_primary if user else None
- accs = [x for x in self.accounts[plugin] if x.isUsable() and (x.shared or x.owner == uid)]
+ # TODO: temporary allowed None user
+ accs = [x for x in self.accounts[plugin] if x.isUsable() and (x.shared or uid is None or x.owner == uid)]
if accs: return choice(accs)
@lock
diff --git a/pyload/database/FileDatabase.py b/pyload/database/FileDatabase.py
index 1dc35e028..649c1f1ef 100644
--- a/pyload/database/FileDatabase.py
+++ b/pyload/database/FileDatabase.py
@@ -311,10 +311,10 @@ class FileMethods(DatabaseMethods):
""" data is list of tuples (name, size, status,[ hash,] url)"""
# inserts media type as n-1th arguments
- data = [t[:-1] + (guess_type(t[0]),) + t[-1] for t in data]
+ data = [t[:-1] + (guess_type(t[0]), t[-1]) for t in data]
# status in (NA, Offline, Online, Queued, TempOffline)
- if data and len(data[0]) == 4:
+ if data and len(data[0]) == 5:
self.c.executemany(
'UPDATE files SET name=?, size=?, dlstatus=?, media=? WHERE url=? AND dlstatus IN (0,1,2,3,11)',
data)