diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-02-13 14:36:21 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-02-13 14:36:21 +0100 |
commit | 0a453a4ae0294910eb8a1076d9f291b78c7e7eb3 (patch) | |
tree | 47a64582b91dc69e417f7af10f988b5cea5b40ed | |
parent | If the account is not yet aware of `trafficleft`, force an update to the acco... (diff) | |
download | pyload-0a453a4ae0294910eb8a1076d9f291b78c7e7eb3.tar.xz |
little account, hoster fix
-rw-r--r-- | module/plugins/Account.py | 6 | ||||
-rw-r--r-- | module/plugins/Hoster.py | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py index 704299827..323c8b545 100644 --- a/module/plugins/Account.py +++ b/module/plugins/Account.py @@ -152,11 +152,11 @@ class Account(Base, AccountInfo): return self.core.requestFactory.getRequest(self.__name__, self.cj) def getDownloadSettings(self): - """ Can be overwritten to change download settings. Default is no chunkLimit, multiDL, resumeDownload + """ Can be overwritten to change download settings. Default is no chunkLimit, max dl limit, resumeDownload - :return: (chunkLimit, multiDL, resumeDownload) / (int,bool,bool) + :return: (chunkLimit, limitDL, resumeDownload) / (int, int ,bool) """ - return -1, True, True + return -1, 0, True @lock def getAccountInfo(self, force=False): diff --git a/module/plugins/Hoster.py b/module/plugins/Hoster.py index 05f55ebc8..fc9e23132 100644 --- a/module/plugins/Hoster.py +++ b/module/plugins/Hoster.py @@ -90,7 +90,7 @@ class Hoster(Base): #: Browser instance, see `network.Browser` self.req = self.account.getAccountRequest() # Default: -1, True, True - self.chunkLimit, self.resumeDownload, self.multiDL = self.account.getDownloadSettings() + self.chunkLimit, self.limitDL, self.resumeDownload = self.account.getDownloadSettings() self.premium = self.account.isPremium() else: self.req = self.core.requestFactory.getRequest(self.__name__) @@ -131,7 +131,10 @@ class Hoster(Base): if self.account: limit = self.account.options.get("limitDL", 0) if limit == "": limit = 0 - return int(limit) + if self.limitDL > 0: # a limit is already set, we use the minimum + return min(int(limit), self.limitDL) + else: + return int(limit) else: return self.limitDL |