Changed 'searcher.get_search_title' to accept a 'library' instead of the 'media' as a parameter.

This commit is contained in:
Dean Gardiner
2013-12-06 13:53:56 +13:00
parent 45484461b5
commit 1bf6c5a82e
4 changed files with 10 additions and 10 deletions

View File

@@ -171,7 +171,7 @@ class Searcher(SearcherBase):
return False
def correctWords(self, rel_name, media):
media_title = fireEvent('searcher.get_search_title', media, single = True)
media_title = fireEvent('searcher.get_search_title', media['library'], single = True)
media_words = re.split('\W+', simplifyString(media_title))
rel_name = simplifyString(rel_name)

View File

@@ -210,7 +210,7 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
if media.get('type') != 'movie': return
media_title = fireEvent('searcher.get_search_title', media, single = True)
media_title = fireEvent('searcher.get_search_title', media['library'], single = True)
imdb_results = kwargs.get('imdb_results', False)
retention = Env.setting('retention', section = 'nzb')
@@ -343,9 +343,9 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
log.error('Failed searching for next release: %s', traceback.format_exc())
return False
def getSearchTitle(self, media):
if media['type'] == 'movie':
return getTitle(media['library'])
def getSearchTitle(self, library):
if library['type'] == 'movie':
return getTitle(library)
class SearchSetupError(Exception):
pass

View File

@@ -133,11 +133,11 @@ class ShowSearcher(Plugin):
return ret
def getSearchTitle(self, media):
if media['type'] not in ['show', 'season', 'episode']:
def getSearchTitle(self, library):
if library['type'] not in ['show', 'season', 'episode']:
return
show, season, episode = self.getLibraries(media['library'])
show, season, episode = self.getLibraries(library)
if not show:
return None
@@ -173,7 +173,7 @@ class ShowSearcher(Plugin):
return None
# Add the identifier to search title
identifier = fireEvent('library.identifier', media['library'], single = True)
identifier = fireEvent('library.identifier', library, single = True)
# TODO this needs to support other identifier formats
if identifier['season']:

View File

@@ -207,7 +207,7 @@ class YarrProvider(Provider):
self._search(media, quality, results)
# Search possible titles
else:
for title in possibleTitles(fireEvent('searcher.get_search_title', media, single = True)):
for title in possibleTitles(fireEvent('searcher.get_search_title', media['library'], single = True)):
self._searchOnTitle(title, media, quality, results)
return results