diff --git a/main/CHANGELOG.txt b/main/CHANGELOG.txt index 8623cd5..fc7e841 100644 --- a/main/CHANGELOG.txt +++ b/main/CHANGELOG.txt @@ -1,6 +1,8 @@ ------------------------------------------------------------------------------- 0.5.1 RC1 by The SABnzbd-Team ------------------------------------------------------------------------------- +- Add 'size_limit' option. Any job bigger than this limit will be set to + low priority and be paused. - TV Season sort now has "affected categories" too. Check your settings!! - Fixed problems that could lead to an infinite unpacking loop (when using a "sick" NZB and using +U instead of +D postprocessing) diff --git a/main/ISSUES.txt b/main/ISSUES.txt index e159640..03334b2 100644 --- a/main/ISSUES.txt +++ b/main/ISSUES.txt @@ -2,6 +2,10 @@ *** Known issues *** ******************************************* +- To prevent unexpectedly large NZBs from eating your quotum you can set + the option 'size_limit' in the INI file. + Any NZB larger than this size will be set to paused and get a low priority. + - When par2 or unrar hang up, never just stop SABnzbd. Instead use your operating system's task manager to stop the par2 or unrar program. Forcing SABnzbd to quit may damage your queues. diff --git a/main/language/email-fr-fr.tmpl b/main/language/email-fr-fr.tmpl index ff8137f..d0e14aa 100644 --- a/main/language/email-fr-fr.tmpl +++ b/main/language/email-fr-fr.tmpl @@ -1,41 +1,41 @@ ## -## Default Email template for SABnzbd -## This a Cheetah template +## Template Email pour SABnzbd +## Ceci est un template Cheetah ## Documentation: http://sabnzbd.wikidot.com/email-templates ## -## Newlines and whitespace are significant! +## Les retours à la ligne et les espaces sont importants ! ## -## These are the email headers +## Entêtes de l'email to: $to from: $from date: $date -subject: SABnzbd has job $name +subject: SABnzbd du téléchargement $name X-priority: 5 X-MS-priority: 5 -## After this comes the body, the empty line is required! +## Le contenu du message, la ligne vide est obligatoire ! -Hi, +Bonjour, -SABnzbd has downloaded "$name" +SABnzbd a téléchargé avec succès "$name" -SABnzbd has failed to download "$name" +SABnzbd a téléchargé sans succès "$name" -Finished at $end_time -Downloaded $size +Terminé à $end_time +Téléchargé $size -Results of the job: +Résultat du téléchargement : -Stage $stage +Etape $stage $result -Output from user script "$script" (Exit code = $script_ret): +Sortie du script utilisateur "$script" (Code Retour = $script_ret): $script_output -Enjoy! +A bientôt ! -Sorry! +Désolé ! diff --git a/main/sabnzbd/cfg.py b/main/sabnzbd/cfg.py index 96b261e..0401db1 100644 --- a/main/sabnzbd/cfg.py +++ b/main/sabnzbd/cfg.py @@ -119,7 +119,7 @@ schedules = OptionList('misc', 'schedlines') enable_tv_sorting = OptionBool('misc', 'enable_tv_sorting', False) tv_sort_string = OptionStr('misc', 'tv_sort_string') tv_sort_countries = OptionNumber('misc', 'tv_sort_countries', 1) -tv_categories = OptionList('misc', 'tv_categories', ['tv']) +tv_categories = OptionList('misc', 'tv_categories', '') enable_movie_sorting = OptionBool('misc', 'enable_movie_sorting', False) movie_sort_string = OptionStr('misc', 'movie_sort_string') @@ -147,6 +147,7 @@ admin_dir = OptionDir('misc', 'admin_dir', 'admin', validation=validate_safedir) #log_dir = OptionDir('misc', 'log_dir', 'logs') dirscan_dir = OptionDir('misc', 'dirscan_dir', create=False) dirscan_speed = OptionNumber('misc', 'dirscan_speed', DEF_SCANRATE, 1, 3600) +SIZE_LIMIT = OptionStr('misc', 'size_limit') cherryhost = OptionStr('misc','host', DEF_HOST) if sabnzbd.WIN32: diff --git a/main/sabnzbd/config.py b/main/sabnzbd/config.py index a154150..08263b2 100644 --- a/main/sabnzbd/config.py +++ b/main/sabnzbd/config.py @@ -213,10 +213,15 @@ class OptionList(Option): Option.__init__(self, section, keyword, default_val, add=add) def set(self, value): - """ Set value, convert single item to list of one """ + """ Set value, convert single item to list of one + Empty string will be an empty list. + """ if value != None: if type(value) != type([]): - value = [ value ] + if value == '': + value = [] + else: + value = [ value ] return self._Option__set(value) return None diff --git a/main/sabnzbd/misc.py b/main/sabnzbd/misc.py index da9be2d..db2e3f5 100644 --- a/main/sabnzbd/misc.py +++ b/main/sabnzbd/misc.py @@ -45,7 +45,7 @@ if sabnzbd.FOUNDATION: import Foundation RE_VERSION = re.compile('(\d+)\.(\d+)\.(\d+)([a-zA-Z]*)(\d*)') -RE_UNITS = re.compile('(\d+\.*\d*)\s*([KMGTP]*)', re.I) +RE_UNITS = re.compile('(\d+\.*\d*)\s*([KMGTP]{0,1})', re.I) TAB_UNITS = ('', 'K', 'M', 'G', 'T', 'P') PANIC_NONE = 0 diff --git a/main/sabnzbd/nzbstuff.py b/main/sabnzbd/nzbstuff.py index f5ae309..0907591 100644 --- a/main/sabnzbd/nzbstuff.py +++ b/main/sabnzbd/nzbstuff.py @@ -23,7 +23,6 @@ import os import time import re import logging -import sabnzbd import datetime import xml.sax import xml.sax.handler @@ -594,6 +593,14 @@ class NzbObject(TryList): # Set nzo save-delay to 6 sec per GB with a max of 5 min self.extra4 = min(6.0 * float(self.__bytes) / GIGI, 300.0) + # Pause job when above size limit + limit = cfg.SIZE_LIMIT.get_int() + if limit and self.__bytes > limit: + logging.info('Job too large, forcing low prio and paused (%s)', self.__dirname) + self.pause_nzo() + self.set_priority(LOW_PRIORITY) + + ## begin nzo.Mutators ##################################################### ## excluding nzo.__try_list ############################################### def check_for_dupe(self, nzf): diff --git a/main/sabnzbd/tvsort.py b/main/sabnzbd/tvsort.py index 145a86c..36b3f1e 100644 --- a/main/sabnzbd/tvsort.py +++ b/main/sabnzbd/tvsort.py @@ -169,7 +169,7 @@ class SeriesSorter: def match(self): ''' Checks the regex for a match, if so set self.match to true ''' if cfg.enable_tv_sorting() and cfg.tv_sort_string(): - if (self.cat and self.cat.lower() in self.cats) or (not self.cat and 'None' in self.cats): + if (not self.cats) or (self.cat and self.cat.lower() in self.cats) or (not self.cat and 'None' in self.cats): #First check if the show matches TV episode regular expressions. Returns regex match object self.match_obj, self.extras = check_regexs(self.original_dirname, series_match, double=True) if self.match_obj: