diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 0e69bdcb..83c5ca08 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -669,21 +669,26 @@ def get_all_episodes_from_absolute_number(show, absolute_numbers, indexer_id=Non return (season, episodes) -def sanitizeSceneName(name, ezrss=False): +def sanitizeSceneName(name, ezrss=False, anime=False): """ Takes a show name and returns the "scenified" version of it. ezrss: If true the scenified version will follow EZRSS's cracksmoker rules as best as possible + + anime: Some show have a ' in their name(Kuroko's Basketball) and is needed for search. Returns: A string containing the scene version of the show name given. """ if name: - if not ezrss: - bad_chars = u",:()'!?\u2019" + # anime: removed ' for Kuroko's Basketball + if anime: + bad_chars = u",:()!?\u2019" # ezrss leaves : and ! in their show names as far as I can tell - else: + elif ezrss: bad_chars = u",()'?\u2019" + else: + bad_chars = u",:()'!?\u2019" # strip out any bad chars for x in bad_chars: diff --git a/sickbeard/providers/nyaatorrents.py b/sickbeard/providers/nyaatorrents.py index 09fd7b17..46468628 100644 --- a/sickbeard/providers/nyaatorrents.py +++ b/sickbeard/providers/nyaatorrents.py @@ -61,7 +61,7 @@ class NyaaProvider(generic.TorrentProvider): return generic.TorrentProvider.findSearchResults(self, show, episodes, search_mode, manualSearch) def _get_season_search_strings(self, ep_obj): - return show_name_helpers.makeSceneShowSearchStrings(self.show) + return show_name_helpers.makeSceneShowSearchStrings(self.show, anime=True) def _get_episode_search_strings(self, ep_obj, add_string=''): return self._get_season_search_strings(ep_obj) diff --git a/sickbeard/show_name_helpers.py b/sickbeard/show_name_helpers.py index 357649a0..3ffbf142 100644 --- a/sickbeard/show_name_helpers.py +++ b/sickbeard/show_name_helpers.py @@ -20,6 +20,7 @@ import os import re import datetime +from functools import partial import sickbeard from sickbeard import common @@ -114,11 +115,15 @@ def sceneToNormalShowNames(name): return list(set(results)) -def makeSceneShowSearchStrings(show, season=-1): +def makeSceneShowSearchStrings(show, season=-1, anime=False): showNames = allPossibleShowNames(show, season=season) # scenify the names - return map(sanitizeSceneName, showNames) + if anime: + sanitizeSceneNameAnime = partial(sanitizeSceneName, anime=True) + return map(sanitizeSceneNameAnime, showNames) + else: + return map(sanitizeSceneName, showNames) def makeSceneSeasonSearchString(show, ep_obj, extraSearchType=None):