From 453c1e55c71a96c9529ecdca1d55278cc41088d6 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 18 Jan 2014 18:45:13 +0100 Subject: rewritten download scheduling, improved account manager, db version increased all data will be overwritten --- pyload/datatypes/PyFile.py | 13 +++++++------ pyload/datatypes/User.py | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'pyload/datatypes') diff --git a/pyload/datatypes/PyFile.py b/pyload/datatypes/PyFile.py index 18ac06c50..b83a057aa 100644 --- a/pyload/datatypes/PyFile.py +++ b/pyload/datatypes/PyFile.py @@ -41,10 +41,11 @@ statusMap = { "not possible": 13, "missing": 14, "file mismatch": 15, - "decrypting": 16, - "processing": 17, - "custom": 18, - "unknown": 19, + "occupied": 16, + "decrypting": 17, + "processing": 18, + "custom": 19, + "unknown": 20, } @@ -205,7 +206,7 @@ class PyFile(object): def abortDownload(self): """abort pyfile if possible""" # TODO: abort timeout, currently dead locks - while self.id in self.m.core.threadManager.processingIds(): + while self.id in self.m.core.dlm.processingIds(): self.abort = True if self.plugin and self.plugin.req: self.plugin.req.abort() @@ -225,7 +226,7 @@ class PyFile(object): def finishIfDone(self): """set status to finish and release file if every thread is finished with it""" - if self.id in self.m.core.threadManager.processingIds(): + if self.id in self.m.core.dlm.processingIds(): return False self.setStatus("finished") diff --git a/pyload/datatypes/User.py b/pyload/datatypes/User.py index 645fd0983..fbfb24378 100644 --- a/pyload/datatypes/User.py +++ b/pyload/datatypes/User.py @@ -54,6 +54,9 @@ class User(UserData): def isAdmin(self): return self.hasRole(Role.Admin) + def isOwner(self, obj): + return self.primary is None or obj.owner == self.true_primary + @property def primary(self): """ Primary user id, Internal user handle used for most operations -- cgit v1.2.3