Browse Source

Don't retry an empty but correct NZB retrieved from an indexer.

Also add special option "warn_empty_nzb" to control warning about empty NZBs.
tags/0.7.8RC1
ShyPike 13 years ago
parent
commit
c91291c315
  1. 1
      sabnzbd/cfg.py
  2. 3
      sabnzbd/dirscanner.py
  3. 2
      sabnzbd/interface.py
  4. 8
      sabnzbd/nzbstuff.py
  5. 4
      sabnzbd/urlgrabber.py

1
sabnzbd/cfg.py

@ -178,6 +178,7 @@ size_limit = OptionStr('misc', 'size_limit', '0')
password_file = OptionDir('misc', 'password_file', '', create=False)
fsys_type = OptionNumber('misc', 'fsys_type', 0, 0, 2)
wait_for_dfolder = OptionBool('misc', 'wait_for_dfolder', False)
warn_empty_nzb = OptionBool('misc', 'warn_empty_nzb', True)
cherryhost = OptionStr('misc', 'host', DEF_HOST)
if sabnzbd.WIN32:

3
sabnzbd/dirscanner.py

@ -177,6 +177,9 @@ def ProcessSingleFile(filename, path, pp=None, script=None, cat=None, catdir=Non
except TypeError:
# Duplicate, ignore
nzo = None
except ValueError:
# Empty, but correct file
return -1, nzo_ids
except:
if data.find("<nzb") >= 0 and data.find("</nzb") < 0:
# Looks like an incomplete file, retry

2
sabnzbd/interface.py

@ -1218,7 +1218,7 @@ SPECIAL_BOOL_LIST = \
'never_repair', 'allow_streaming', 'ignore_unrar_dates', 'rss_filenames', 'news_items',
'osx_menu', 'osx_speed', 'win_menu', 'uniconfig', 'use_pickle', 'allow_incomplete_nzb',
'randomize_server_ip', 'no_ipv6', 'keep_awake', 'overwrite_files', 'empty_postproc',
'web_watchdog', 'wait_for_dfolder'
'web_watchdog', 'wait_for_dfolder', 'warn_empty_nzb'
)
SPECIAL_VALUE_LIST = \
( 'size_limit', 'folder_max_length', 'fsys_type', 'movie_rename_limit', 'nomedia_marker',

8
sabnzbd/nzbstuff.py

@ -697,10 +697,14 @@ class NzbObject(TryList):
if not self.files and not reuse:
self.purge_data(keep_basic=False)
if cfg.warn_empty_nzb():
mylog = logging.warning
else:
mylog = logging.info
if self.url:
logging.warning(Ta('Empty NZB file %s') + ' [%s]', filename, self.url)
mylog(Ta('Empty NZB file %s') + ' [%s]', filename, self.url)
else:
logging.warning(Ta('Empty NZB file %s'), filename)
mylog(Ta('Empty NZB file %s'), filename)
raise ValueError
if cat is None:

4
sabnzbd/urlgrabber.py

@ -207,6 +207,10 @@ class URLGrabber(Thread):
if res == -2:
logging.info('Incomplete NZB, retry after 5 min %s', url)
when = 300
elif res == -1:
# Error, but no reason to retry. Warning is already given
NzbQueue.do.remove(future_nzo.nzo_id, add_to_history=False)
continue
else:
logging.info('Unknown error fetching NZB, retry after 2 min %s', url)
when = 120

Loading…
Cancel
Save