Use the "wait for" option properly. fix #3224
This commit is contained in:
@@ -145,9 +145,10 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
|
||||
index = 0
|
||||
for q_identifier in profile.get('qualities'):
|
||||
quality_custom = {
|
||||
'index': index,
|
||||
'quality': q_identifier,
|
||||
'finish': profile['finish'][index],
|
||||
'wait_for': profile['wait_for'][index],
|
||||
'wait_for': tryInt(profile['wait_for'][index]),
|
||||
'3d': profile['3d'][index] if profile.get('3d') else False
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class ProfilePlugin(Plugin):
|
||||
order = 0
|
||||
for type in kwargs.get('types', []):
|
||||
profile['qualities'].append(type.get('quality'))
|
||||
profile['wait_for'].append(tryInt(type.get('wait_for')))
|
||||
profile['wait_for'].append(tryInt(kwargs.get('wait_for', 0)))
|
||||
profile['finish'].append((tryInt(type.get('finish')) == 1) if order > 0 else True)
|
||||
profile['3d'].append(tryInt(type.get('3d')))
|
||||
order += 1
|
||||
|
||||
@@ -41,7 +41,7 @@ var Profile = new Class({
|
||||
new Element('span', {'text':'Wait'}),
|
||||
new Element('input.inlay.xsmall', {
|
||||
'type':'text',
|
||||
'value': data.types && data.types.length > 0 ? data.types[0].wait_for : 0
|
||||
'value': data.wait_for && data.wait_for.length > 0 ? data.wait_for[0] : 0
|
||||
}),
|
||||
new Element('span', {'text':'day(s) for a better quality.'})
|
||||
),
|
||||
@@ -63,8 +63,7 @@ var Profile = new Class({
|
||||
data.types.include({
|
||||
'quality': quality,
|
||||
'finish': data.finish[nr] || false,
|
||||
'3d': data['3d'] ? data['3d'][nr] || false : false,
|
||||
'wait_for': data.wait_for[nr] || 0
|
||||
'3d': data['3d'] ? data['3d'][nr] || false : false
|
||||
})
|
||||
});
|
||||
}
|
||||
@@ -126,8 +125,7 @@ var Profile = new Class({
|
||||
data.types.include({
|
||||
'quality': type.getElement('select').get('value'),
|
||||
'finish': +type.getElement('input.finish[type=checkbox]').checked,
|
||||
'3d': +type.getElement('input.3d[type=checkbox]').checked,
|
||||
'wait_for': 0
|
||||
'3d': +type.getElement('input.3d[type=checkbox]').checked
|
||||
});
|
||||
});
|
||||
|
||||
@@ -340,8 +338,7 @@ Profile.Type = new Class({
|
||||
return {
|
||||
'quality': self.qualities.get('value'),
|
||||
'finish': +self.finish.checked,
|
||||
'3d': +self['3d'].checked,
|
||||
'wait_for': 0
|
||||
'3d': +self['3d'].checked
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -339,8 +339,8 @@ class Release(Plugin):
|
||||
def tryDownloadResult(self, results, media, quality_custom, manual = False):
|
||||
|
||||
for rel in results:
|
||||
if not quality_custom.get('finish', False) 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['name']))
|
||||
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']))
|
||||
continue
|
||||
|
||||
if rel['status'] in ['ignored', 'failed']:
|
||||
|
||||
Reference in New Issue
Block a user