diff options
Diffstat (limited to 'module/plugins')
| -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  | 
