Minor cleanup to Searcher and Matcher

This commit is contained in:
Dean Gardiner
2013-10-16 14:58:52 +13:00
parent 3fa21560be
commit 46d4d34da7
2 changed files with 4 additions and 3 deletions
@@ -157,6 +157,7 @@ class Searcher(SearcherBase):
def search(self, protocols, media, quality):
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)
for search_protocol in protocols:
+3 -3
View File
@@ -1,4 +1,3 @@
import pprint
from caper import Caper
from couchpotato import CPLog, tryInt
from couchpotato.core.event import addEvent, fireEvent
@@ -36,7 +35,7 @@ class Matcher(Plugin):
return None
def chainMatches(self, chain, group, tags):
def chainMatch(self, chain, group, tags):
found_tags = []
for match in chain.info[group]:
@@ -83,6 +82,7 @@ class Matcher(Plugin):
chain_words = [x.lower() for x in chain.info['show_name']]
# Check show titles match
# TODO check xem names
for title in root_library['info']['titles']:
for valid_words in [x.split(' ') for x in possibleTitles(title)]:
@@ -102,7 +102,7 @@ class Matcher(Plugin):
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)
return False