Fixing if NZB contains a file out of your retention

This commit is contained in:
PierreAronnax
2011-09-25 11:51:26 +03:00
parent e9a1e5522a
commit 8fd72f0a19

View File

@@ -496,10 +496,15 @@ def preprocess(resultlist):
d = minidom.parseString(nzb)
node = d.documentElement
nzbfiles = d.getElementsByTagName("file")
skipping = False
for nzbfile in nzbfiles:
if nzbfile.getAttribute("date") < (time.time() - usenet_retention * 86400):
logger.error('NZB contains a file out of your retention. Skipping.')
continue
if int(nzbfile.getAttribute("date")) < (time.time() - usenet_retention * 86400):
logger.info('NZB contains a file out of your retention. Skipping.')
skipping = True
break
if skipping:
continue
#TODO: Do we want rar checking in here to try to keep unknowns out?
#or at least the option to do so?
except ExpatError: