diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-18 18:45:13 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-18 18:45:13 +0100 |
commit | 453c1e55c71a96c9529ecdca1d55278cc41088d6 (patch) | |
tree | 7a516a84e5590ce5f1f3def71c24bcb14f209023 /pyload/datatypes | |
parent | small fixes and improvements for download engine (diff) | |
download | pyload-453c1e55c71a96c9529ecdca1d55278cc41088d6.tar.xz |
rewritten download scheduling, improved account manager, db version increased all data will be overwritten
Diffstat (limited to 'pyload/datatypes')
-rw-r--r-- | pyload/datatypes/PyFile.py | 13 | ||||
-rw-r--r-- | pyload/datatypes/User.py | 3 |
2 files changed, 10 insertions, 6 deletions
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 |