From 46d4d34da76cba0069ba45f873a4359e974691f8 Mon Sep 17 00:00:00 2001 From: Dean Gardiner Date: Wed, 16 Oct 2013 14:48:06 +1300 Subject: [PATCH] Minor cleanup to Searcher and Matcher --- couchpotato/core/media/_base/searcher/main.py | 1 + couchpotato/core/plugins/matcher/main.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/media/_base/searcher/main.py b/couchpotato/core/media/_base/searcher/main.py index 1f6e9f33..0ea8b232 100644 --- a/couchpotato/core/media/_base/searcher/main.py +++ b/couchpotato/core/media/_base/searcher/main.py @@ -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: diff --git a/couchpotato/core/plugins/matcher/main.py b/couchpotato/core/plugins/matcher/main.py index d9b76001..64237e2e 100644 --- a/couchpotato/core/plugins/matcher/main.py +++ b/couchpotato/core/plugins/matcher/main.py @@ -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