Ignore "wait for" for all if 1 is old enough
This commit is contained in:
1 parent
3c6b86ea28
commit
e06b4ccb3f
1 file changed
+21
-4
@@ -339,11 +339,11 @@ class Release(Plugin):
|
|||||||
def tryDownloadResult(self, results, media, quality_custom, manual = False):
|
def tryDownloadResult(self, results, media, quality_custom, manual = False):
|
||||||
|
|
||||||
wait_for = False
|
wait_for = False
|
||||||
|
let_through = False
|
||||||
|
filtered_results = []
|
||||||
|
|
||||||
|
# If a single release comes through the "wait for", let through all
|
||||||
for rel in results:
|
for rel in results:
|
||||||
if quality_custom.get('index') != 0 and quality_custom.get('wait_for', 0) > 0 and rel.get('age') <= quality_custom.get('wait_for', 0):
|
|
||||||
log.info('Ignored, waiting %s days: %s', (quality_custom.get('wait_for') - rel.get('age'), rel['name']))
|
|
||||||
wait_for = True
|
|
||||||
continue
|
|
||||||
|
|
||||||
if rel['status'] in ['ignored', 'failed']:
|
if rel['status'] in ['ignored', 'failed']:
|
||||||
log.info('Ignored: %s', rel['name'])
|
log.info('Ignored: %s', rel['name'])
|
||||||
@@ -353,6 +353,23 @@ class Release(Plugin):
|
|||||||
log.info('Ignored, score to low: %s', rel['name'])
|
log.info('Ignored, score to low: %s', rel['name'])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
rel['wait_for'] = False
|
||||||
|
if quality_custom.get('index') != 0 and quality_custom.get('wait_for', 0) > 0 and rel.get('age') <= quality_custom.get('wait_for', 0):
|
||||||
|
rel['wait_for'] = True
|
||||||
|
else:
|
||||||
|
let_through = True
|
||||||
|
|
||||||
|
filtered_results.append(rel)
|
||||||
|
|
||||||
|
# Loop through filtered results
|
||||||
|
for rel in filtered_results:
|
||||||
|
|
||||||
|
# Only wait if not a single release is old enough
|
||||||
|
if rel.get('wait_for') and not let_through:
|
||||||
|
log.info('Ignored, waiting %s days: %s', (quality_custom.get('wait_for') - rel.get('age'), rel['name']))
|
||||||
|
wait_for = True
|
||||||
|
continue
|
||||||
|
|
||||||
downloaded = fireEvent('release.download', data = rel, media = media, manual = manual, single = True)
|
downloaded = fireEvent('release.download', data = rel, media = media, manual = manual, single = True)
|
||||||
if downloaded is True:
|
if downloaded is True:
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in new issue
Block a user