Minor cleanup to Searcher and Matcher
This commit is contained in:
1 parent
3fa21560be
commit
46d4d34da7
2 files changed
+4
-3
No files matched your search
@@ -157,6 +157,7 @@ class Searcher(SearcherBase):
|
|||||||
def search(self, protocols, media, quality):
|
def search(self, protocols, media, quality):
|
||||||
results = []
|
results = []
|
||||||
|
|
||||||
|
# TODO could this be handled better? (removing the need for 'searcher.get_media_searcher_id')
|
||||||
searcher_id = fireEvent('searcher.get_media_searcher_id', media['type'], single = True)
|
searcher_id = fireEvent('searcher.get_media_searcher_id', media['type'], single = True)
|
||||||
|
|
||||||
for search_protocol in protocols:
|
for search_protocol in protocols:
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import pprint
|
|
||||||
from caper import Caper
|
from caper import Caper
|
||||||
from couchpotato import CPLog, tryInt
|
from couchpotato import CPLog, tryInt
|
||||||
from couchpotato.core.event import addEvent, fireEvent
|
from couchpotato.core.event import addEvent, fireEvent
|
||||||
@@ -36,7 +35,7 @@ class Matcher(Plugin):
|
|||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def chainMatches(self, chain, group, tags):
|
def chainMatch(self, chain, group, tags):
|
||||||
found_tags = []
|
found_tags = []
|
||||||
|
|
||||||
for match in chain.info[group]:
|
for match in chain.info[group]:
|
||||||
@@ -83,6 +82,7 @@ class Matcher(Plugin):
|
|||||||
chain_words = [x.lower() for x in chain.info['show_name']]
|
chain_words = [x.lower() for x in chain.info['show_name']]
|
||||||
|
|
||||||
# Check show titles match
|
# Check show titles match
|
||||||
|
# TODO check xem names
|
||||||
for title in root_library['info']['titles']:
|
for title in root_library['info']['titles']:
|
||||||
for valid_words in [x.split(' ') for x in possibleTitles(title)]:
|
for valid_words in [x.split(' ') for x in possibleTitles(title)]:
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ class Matcher(Plugin):
|
|||||||
|
|
||||||
video_tags = quality_map[quality['identifier']]
|
video_tags = quality_map[quality['identifier']]
|
||||||
|
|
||||||
if not self.chainMatches(chain, 'video', video_tags):
|
if not self.chainMatch(chain, 'video', video_tags):
|
||||||
log.info2('Wrong: %s tags not in chain', video_tags)
|
log.info2('Wrong: %s tags not in chain', video_tags)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user