Change add blacklog search terms for anime PROPERS.

This commit is contained in:
Prinz23 2018-05-24 22:21:19 +02:00 committed by JackDandy
parent 61e57c747f
commit 0644ec2e61
3 changed files with 17 additions and 7 deletions

View file

@ -1,4 +1,9 @@
### 0.16.12 (2018-05-25 00:40:00 UTC) ### 0.16.13 (2018-05-26 17:00:00 UTC)
* Change add blacklog search terms for anime PROPERS
### 0.16.12 (2018-05-25 00:40:00 UTC)
* Fix anime parser and anime PROPER level * Fix anime parser and anime PROPER level

View file

@ -1239,7 +1239,7 @@ class NZBProvider(GenericProvider):
regex += ['proper|repack', Quality.real_check] regex += ['proper|repack', Quality.real_check]
proper_check = re.compile(r'(?i)(\b%s\b)' % '|'.join(regex)) proper_check = re.compile(r'(?i)(\b%s\b)' % '|'.join(regex))
if anime: if anime:
terms = 'v1|v2|v3|v4|v5' terms = 'v2|v3|v4|v5|v6|v7|v8|v9'
search_terms += [terms] search_terms += [terms]
regex += [terms] regex += [terms]
proper_check = re.compile(r'(?i)(%s)' % '|'.join(regex)) proper_check = re.compile(r'(?i)(%s)' % '|'.join(regex))
@ -1643,7 +1643,7 @@ class TorrentProvider(GenericProvider):
raise AuthException('%s for %s is empty in Media Providers/Options' % (setting, self.name)) raise AuthException('%s for %s is empty in Media Providers/Options' % (setting, self.name))
def find_propers(self, **kwargs): def find_propers(self, anime=False, **kwargs):
""" """
Search for releases of type PROPER Search for releases of type PROPER
:return: list of Proper objects :return: list of Proper objects
@ -1652,10 +1652,15 @@ class TorrentProvider(GenericProvider):
if self.should_skip(): if self.should_skip():
return results return results
search_terms = getattr(self, 'proper_search_terms', ['proper', 'repack', 'real']) # chance of a v6-v9 is so rare that to do every bl search with each in turn is too aggressive
search_terms = getattr(self, 'proper_search_terms', ['proper', 'repack', 'real'] +
([], ['v2', 'v3', 'v4', 'v5'])[True is anime])
if not isinstance(search_terms, list): if not isinstance(search_terms, list):
if None is search_terms: if None is search_terms:
search_terms = 'proper|repack|real' search_terms = ['proper|repack|real']
if anime:
search_terms += ['v2|v3|v4|v5']
else:
search_terms = [search_terms] search_terms = [search_terms]
items = self._search_provider({'Propers': search_terms}) items = self._search_provider({'Propers': search_terms})

View file

@ -860,7 +860,7 @@ class NewznabProvider(generic.NZBProvider):
regex += ['proper|repack', Quality.real_check] regex += ['proper|repack', Quality.real_check]
proper_check = re.compile(r'(?i)(\b%s\b)' % '|'.join(regex)) proper_check = re.compile(r'(?i)(\b%s\b)' % '|'.join(regex))
if anime: if anime:
terms = 'v1|v2|v3|v4|v5' terms = 'v2|v3|v4|v5|v6|v7|v8|v9'
search_terms += [terms] search_terms += [terms]
regex += [terms] regex += [terms]
proper_check = re.compile(r'(?i)(%s)' % '|'.join(regex)) proper_check = re.compile(r'(?i)(%s)' % '|'.join(regex))