1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-13 21:05:11 -05:00

Merge pull request #790 from rleadbetter/leading_zero_anime

Leading zero fix for Anime.
This commit is contained in:
adam111316 2014-09-11 16:58:40 +08:00
commit e2791ed1ad
3 changed files with 6 additions and 6 deletions

View File

@ -176,7 +176,7 @@ class KATProvider(generic.TorrentProvider):
ep_string = show_name + ' Season ' + str(ep_obj.airdate).split('-')[0] ep_string = show_name + ' Season ' + str(ep_obj.airdate).split('-')[0]
search_string['Season'].append(ep_string) search_string['Season'].append(ep_string)
elif ep_obj.show.anime: elif ep_obj.show.anime:
ep_string = show_name + ' ' + "%d" % ep_obj.scene_absolute_number ep_string = show_name + ' ' + "%02d" % ep_obj.scene_absolute_number
search_string['Season'].append(ep_string) search_string['Season'].append(ep_string)
else: else:
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) + ' -S%02d' % int( ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) + ' -S%02d' % int(
@ -205,7 +205,7 @@ class KATProvider(generic.TorrentProvider):
elif self.show.anime: elif self.show.anime:
for show_name in set(allPossibleShowNames(self.show)): for show_name in set(allPossibleShowNames(self.show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \ ep_string = sanitizeSceneName(show_name) + ' ' + \
"%i" % int(ep_obj.scene_absolute_number) "%02i" % int(ep_obj.scene_absolute_number)
search_string['Episode'].append(ep_string) search_string['Episode'].append(ep_string)
else: else:
for show_name in set(allPossibleShowNames(self.show)): for show_name in set(allPossibleShowNames(self.show)):

View File

@ -177,7 +177,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
ep_string = show_name + ' Season ' + str(ep_obj.airdate).split('-')[0] ep_string = show_name + ' Season ' + str(ep_obj.airdate).split('-')[0]
search_string['Season'].append(ep_string) search_string['Season'].append(ep_string)
elif ep_obj.show.anime: elif ep_obj.show.anime:
ep_string = show_name + ' ' + "%d" % ep_obj.scene_absolute_number ep_string = show_name + ' ' + "%02d" % ep_obj.scene_absolute_number
search_string['Season'].append(ep_string) search_string['Season'].append(ep_string)
else: else:
ep_string = show_name + ' S%02d' % int(ep_obj.scene_season) ep_string = show_name + ' S%02d' % int(ep_obj.scene_season)
@ -207,7 +207,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
elif self.show.anime: elif self.show.anime:
for show_name in set(allPossibleShowNames(self.show)): for show_name in set(allPossibleShowNames(self.show)):
ep_string = sanitizeSceneName(show_name) + ' ' + \ ep_string = sanitizeSceneName(show_name) + ' ' + \
"%i" % int(ep_obj.scene_absolute_number) "%02i" % int(ep_obj.scene_absolute_number)
search_string['Episode'].append(ep_string) search_string['Episode'].append(ep_string)
else: else:
for show_name in set(allPossibleShowNames(self.show)): for show_name in set(allPossibleShowNames(self.show)):

View File

@ -143,7 +143,7 @@ def makeSceneSeasonSearchString(show, ep_obj, extraSearchType=None):
common.SNATCHED) and curQuality < highestBestQuality) or curStatus == common.WANTED: common.SNATCHED) and curQuality < highestBestQuality) or curStatus == common.WANTED:
ab_number = episode.scene_absolute_number ab_number = episode.scene_absolute_number
if ab_number > 0: if ab_number > 0:
seasonStrings.append("%d" % ab_number) seasonStrings.append("%02d" % ab_number)
else: else:
myDB = db.DBConnection() myDB = db.DBConnection()
@ -190,7 +190,7 @@ def makeSceneSearchString(show, ep_obj):
if (show.air_by_date or show.sports) and ep_obj.airdate != datetime.date.fromordinal(1): if (show.air_by_date or show.sports) and ep_obj.airdate != datetime.date.fromordinal(1):
epStrings = [str(ep_obj.airdate)] epStrings = [str(ep_obj.airdate)]
elif show.is_anime: elif show.is_anime:
epStrings = ["%i" % int(ep_obj.scene_absolute_number)] epStrings = ["%02i" % int(ep_obj.scene_absolute_number)]
else: else:
epStrings = ["S%02iE%02i" % (int(ep_obj.scene_season), int(ep_obj.scene_episode)), epStrings = ["S%02iE%02i" % (int(ep_obj.scene_season), int(ep_obj.scene_episode)),
"%ix%02i" % (int(ep_obj.scene_season), int(ep_obj.scene_episode))] "%ix%02i" % (int(ep_obj.scene_season), int(ep_obj.scene_episode))]