Use label for quality guess also. closes #2237
This commit is contained in:
@@ -194,13 +194,16 @@ class QualityPlugin(Plugin):
|
|||||||
def containsTag(self, quality, words, cur_file = ''):
|
def containsTag(self, quality, words, cur_file = ''):
|
||||||
|
|
||||||
# Check alt and tags
|
# Check alt and tags
|
||||||
for tag_type in ['alternative', 'tags']:
|
for tag_type in ['alternative', 'tags', 'label']:
|
||||||
for alt in quality.get(tag_type, []):
|
qualities = quality.get(tag_type, [])
|
||||||
if isinstance(alt, tuple) and '.'.join(alt) in '.'.join(words):
|
qualities = [qualities] if isinstance(qualities, (str, unicode)) else qualities
|
||||||
|
|
||||||
|
for alt in qualities:
|
||||||
|
if (isinstance(alt, tuple) and '.'.join(alt) in '.'.join(words)) or (isinstance(alt, (str, unicode)) and alt.lower() in cur_file.lower()):
|
||||||
log.debug('Found %s via %s %s in %s', (quality['identifier'], tag_type, quality.get(tag_type), cur_file))
|
log.debug('Found %s via %s %s in %s', (quality['identifier'], tag_type, quality.get(tag_type), cur_file))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if list(set(quality.get(tag_type, [])) & set(words)):
|
if list(set(qualities) & set(words)):
|
||||||
log.debug('Found %s via %s %s in %s', (quality['identifier'], tag_type, quality.get(tag_type), cur_file))
|
log.debug('Found %s via %s %s in %s', (quality['identifier'], tag_type, quality.get(tag_type), cur_file))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user