Skip to content

Commit

Permalink
More unicode support for GenericProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
medariox committed May 3, 2016
1 parent 2c3df70 commit 2b649ef
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions sickrage/providers/GenericProvider.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# coding=utf-8
# This file is part of SickRage.
#

# Git: https://github.com/PyMedusa/SickRage.git
#
# SickRage is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -180,7 +179,7 @@ def find_search_results(self, show, episodes, search_mode, forced_search=False,
try:
parse_result = NameParser(parse_method=('normal', 'anime')[show.is_anime]).parse(title)
except (InvalidNameException, InvalidShowException) as error:
logger.log(u"{}".format(error), logger.DEBUG)
logger.log(u'{}'.format(error), logger.DEBUG)
continue

show_object = parse_result.show
Expand Down Expand Up @@ -398,13 +397,13 @@ def _get_episode_search_strings(self, episode, add_string=''):
}

for show_name in allPossibleShowNames(episode.show, season=episode.scene_season):
episode_string = show_name + ' '
episode_string = show_name + u' '

if episode.show.air_by_date:
episode_string += str(episode.airdate).replace('-', ' ')
episode_string += unicode(episode.airdate).replace(u'-', u' ')
elif episode.show.sports:
episode_string += str(episode.airdate).replace('-', ' ')
episode_string += ('|', ' ')[len(self.proper_strings) > 1]
episode_string += unicode(episode.airdate).replace(u'-', u' ')
episode_string += (u'|', u' ')[len(self.proper_strings) > 1]
episode_string += episode.airdate.strftime('%b')
elif episode.show.anime:
episode_string += '%02d' % int(episode.scene_absolute_number)
Expand All @@ -415,9 +414,9 @@ def _get_episode_search_strings(self, episode, add_string=''):
}

if add_string:
episode_string += ' ' + add_string
episode_string += u' ' + add_string

search_string['Episode'].append(episode_string.encode('utf-8').strip())
search_string['Episode'].append(episode_string.strip())

return [search_string]

Expand Down Expand Up @@ -451,15 +450,17 @@ def _get_result_info(self, item): # pylint: disable=no-self-use

def _get_pubdate(self, item): # pylint: disable=unused-argument,no-self-use
"""
Return publish date of the item. If provider doesnt
have _get_pubdate function this will be used
Return publish date of the item.
If provider doesnt have _get_pubdate function this will be used
"""
return None

def _get_hash(self, item): # pylint: disable=unused-argument,no-self-use
"""
Return hash of the item. If provider doesnt
have _get_hash function this will be used
Return hash of the item.
If provider doesnt have _get_hash function this will be used
"""
return None

Expand Down

0 comments on commit 2b649ef

Please sign in to comment.