diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-20 00:01:15 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-20 00:01:15 +0100 |
commit | 21791b33f033c7a182e64ca6f878bf0ec1d8f88d (patch) | |
tree | 66e8063781b61a720dd52520cc6935987ee44ce2 /module/plugins/Hoster.py | |
parent | corrected log method (diff) | |
download | pyload-21791b33f033c7a182e64ca6f878bf0ec1d8f88d.tar.xz |
parallel dl limit for hoster
Diffstat (limited to 'module/plugins/Hoster.py')
-rw-r--r-- | module/plugins/Hoster.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/module/plugins/Hoster.py b/module/plugins/Hoster.py index 4a5d15759..c30fed412 100644 --- a/module/plugins/Hoster.py +++ b/module/plugins/Hoster.py @@ -65,7 +65,6 @@ class Hoster(Base): self.wantReconnect = False #: enables simultaneous processing of multiple downloads - self.multiDL = True self.limitDL = 0 #: chunk limit self.chunkLimit = 1 @@ -113,11 +112,30 @@ class Hoster(Base): self.init() + def getMultiDL(self): + self.logDebug("Deprectated attribute multiDL, use limitDL instead") + return self.limitDL <= 0 + + def setMultiDL(self, val): + self.logDebug("Deprectated attribute multiDL, use limitDL instead") + self.limitDL = 0 if val else 1 + + multiDL = property(getMultiDL, setMultiDL) + def getChunkCount(self): if self.chunkLimit <= 0: return self.config["download"]["chunks"] return min(self.config["download"]["chunks"], self.chunkLimit) + def getDownloadLimit(self): + if self.account: + limit = self.account.options.get("limitDL", 0) + if limit == "": limit = 0 + return int(limit) + else: + return self.limitDL + + def __call__(self): return self.__name__ |