|
@ -223,16 +223,11 @@ def get_show_names(ep_obj, spacer='.'): |
|
|
:param spacer: spacer |
|
|
:param spacer: spacer |
|
|
:return: |
|
|
:return: |
|
|
""" |
|
|
""" |
|
|
old_anime, old_dirty = ep_obj.show_obj.is_anime, ep_obj.show_obj.dirty |
|
|
return get_show_names_all_possible(ep_obj.show_obj, season=ep_obj.season, spacer=spacer, force_anime=True) |
|
|
ep_obj.show_obj.anime = 1 # used to limit results from all_possible(...) |
|
|
|
|
|
show_names = get_show_names_all_possible(ep_obj.show_obj, season=ep_obj.season, spacer=spacer) |
|
|
|
|
|
ep_obj.show_obj.anime = old_anime # temporary measure, so restore property then dirty flag |
|
|
|
|
|
ep_obj.show_obj.dirty = old_dirty |
|
|
|
|
|
return show_names |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_show_names_all_possible(show_obj, season=-1, scenify=True, spacer='.'): |
|
|
def get_show_names_all_possible(show_obj, season=-1, scenify=True, spacer='.', force_anime=False): |
|
|
# type: (sickbeard.tv.TVShow, int, bool, AnyStr) -> List[AnyStr] |
|
|
# type: (sickbeard.tv.TVShow, int, bool, AnyStr, bool) -> List[AnyStr] |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
:param show_obj: show object |
|
|
:param show_obj: show object |
|
@ -241,7 +236,7 @@ def get_show_names_all_possible(show_obj, season=-1, scenify=True, spacer='.'): |
|
|
:param spacer: spacer |
|
|
:param spacer: spacer |
|
|
:return: |
|
|
:return: |
|
|
""" |
|
|
""" |
|
|
show_names = list(set(allPossibleShowNames(show_obj, season=season))) # type: List[AnyStr] |
|
|
show_names = list(set(allPossibleShowNames(show_obj, season=season, force_anime=force_anime))) # type: List[AnyStr] |
|
|
if scenify: |
|
|
if scenify: |
|
|
show_names = map_list(sanitize_scene_name, show_names) |
|
|
show_names = map_list(sanitize_scene_name, show_names) |
|
|
return url_encode(show_names, spacer) |
|
|
return url_encode(show_names, spacer) |
|
@ -380,8 +375,8 @@ def makeSceneSearchString(show_obj, # type: sickbeard.tv.TVShow |
|
|
return to_return |
|
|
return to_return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def allPossibleShowNames(show_obj, season=-1): |
|
|
def allPossibleShowNames(show_obj, season=-1, force_anime=False): |
|
|
# type: (sickbeard.tv.TVShow, int) -> List[AnyStr] |
|
|
# type: (sickbeard.tv.TVShow, int, bool) -> List[AnyStr] |
|
|
""" |
|
|
""" |
|
|
Figures out every possible variation of the name for a particular show. Includes TVDB name, TVRage name, |
|
|
Figures out every possible variation of the name for a particular show. Includes TVDB name, TVRage name, |
|
|
country codes on the end, eg. "Show Name (AU)", and any scene exception names. |
|
|
country codes on the end, eg. "Show Name (AU)", and any scene exception names. |
|
@ -399,7 +394,7 @@ def allPossibleShowNames(show_obj, season=-1): |
|
|
if season in [-1, 1]: |
|
|
if season in [-1, 1]: |
|
|
showNames.append(show_obj.name) |
|
|
showNames.append(show_obj.name) |
|
|
|
|
|
|
|
|
if not show_obj.is_anime: |
|
|
if not show_obj.is_anime and not force_anime: |
|
|
newShowNames = [] |
|
|
newShowNames = [] |
|
|
country_list = common.countryList |
|
|
country_list = common.countryList |
|
|
country_list.update(dict(zip(itervalues(common.countryList), iterkeys(common.countryList)))) |
|
|
country_list.update(dict(zip(itervalues(common.countryList), iterkeys(common.countryList)))) |
|
|