diff --git a/sickbeard/providers/hdtorrents.py b/sickbeard/providers/hdtorrents.py index 9c7f6a21..df937676 100644 --- a/sickbeard/providers/hdtorrents.py +++ b/sickbeard/providers/hdtorrents.py @@ -135,7 +135,7 @@ class HDTorrentsProvider(generic.TorrentProvider): for show_name in set(show_name_helpers.allPossibleShowNames(show)): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-', '|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(show_name_helpers.allPossibleShowNames(show)): diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py index 1910e768..381e4a4e 100644 --- a/sickbeard/providers/iptorrents.py +++ b/sickbeard/providers/iptorrents.py @@ -117,7 +117,7 @@ class IPTorrentsProvider(generic.TorrentProvider): for show_name in set(show_name_helpers.allPossibleShowNames(show)): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-', '|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(show_name_helpers.allPossibleShowNames(show)): diff --git a/sickbeard/providers/kat.py b/sickbeard/providers/kat.py index c09a137a..6916c70f 100644 --- a/sickbeard/providers/kat.py +++ b/sickbeard/providers/kat.py @@ -196,7 +196,7 @@ class KATProvider(generic.TorrentProvider): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-','|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(allPossibleShowNames(show)): diff --git a/sickbeard/providers/nextgen.py b/sickbeard/providers/nextgen.py index d14242e8..641c96cd 100644 --- a/sickbeard/providers/nextgen.py +++ b/sickbeard/providers/nextgen.py @@ -155,7 +155,7 @@ class NextGenProvider(generic.TorrentProvider): for show_name in set(show_name_helpers.allPossibleShowNames(show)): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-', '|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(show_name_helpers.allPossibleShowNames(show)): diff --git a/sickbeard/providers/publichd.py b/sickbeard/providers/publichd.py index 3c99f9a2..c1bd732e 100644 --- a/sickbeard/providers/publichd.py +++ b/sickbeard/providers/publichd.py @@ -102,7 +102,7 @@ class PublicHDProvider(generic.TorrentProvider): for show_name in set(allPossibleShowNames(show)): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-', '|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(allPossibleShowNames(show)): diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py index a0682caa..c92b0ee6 100644 --- a/sickbeard/providers/scc.py +++ b/sickbeard/providers/scc.py @@ -126,7 +126,7 @@ class SCCProvider(generic.TorrentProvider): for show_name in set(show_name_helpers.allPossibleShowNames(show)): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-', '|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(show_name_helpers.allPossibleShowNames(show)): diff --git a/sickbeard/providers/speedcd.py b/sickbeard/providers/speedcd.py index e8069cd8..accc05f4 100644 --- a/sickbeard/providers/speedcd.py +++ b/sickbeard/providers/speedcd.py @@ -122,7 +122,7 @@ class SpeedCDProvider(generic.TorrentProvider): for show_name in set(show_name_helpers.allPossibleShowNames(show)): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-', '|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(show_name_helpers.allPossibleShowNames(show)): diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py index 4d4fd838..847bddca 100644 --- a/sickbeard/providers/thepiratebay.py +++ b/sickbeard/providers/thepiratebay.py @@ -204,7 +204,7 @@ class ThePirateBayProvider(generic.TorrentProvider): for show_name in set(allPossibleShowNames(show)): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-', '|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(allPossibleShowNames(show)): diff --git a/sickbeard/providers/torrentday.py b/sickbeard/providers/torrentday.py index 89335736..d6b6ca02 100644 --- a/sickbeard/providers/torrentday.py +++ b/sickbeard/providers/torrentday.py @@ -139,7 +139,7 @@ class TorrentDayProvider(generic.TorrentProvider): for show_name in set(show_name_helpers.allPossibleShowNames(show)): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-', '|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(show_name_helpers.allPossibleShowNames(show)): diff --git a/sickbeard/providers/torrentleech.py b/sickbeard/providers/torrentleech.py index a9ac032e..af6d26b9 100644 --- a/sickbeard/providers/torrentleech.py +++ b/sickbeard/providers/torrentleech.py @@ -121,7 +121,7 @@ class TorrentLeechProvider(generic.TorrentProvider): for show_name in set(show_name_helpers.allPossibleShowNames(show)): ep_string = sanitizeSceneName(show_name) + ' ' + \ str(episode).replace('-', '|') + '|' + \ - helpers.custom_strftime('%b', episode) + helpers.custom_strftime('%b', str(episode)) search_string['Episode'].append(ep_string) else: for show_name in set(show_name_helpers.allPossibleShowNames(show)): diff --git a/tests/xem_tests.py b/tests/xem_tests.py index 6bd6f6b6..52b32af1 100644 --- a/tests/xem_tests.py +++ b/tests/xem_tests.py @@ -21,14 +21,14 @@ from __future__ import with_statement import unittest import sys, os.path +import datetime sys.path.append(os.path.abspath('..')) sys.path.append(os.path.abspath('../lib')) import test_lib as test import sickbeard -from sickbeard.helpers import sanitizeSceneName -from sickbeard.show_name_helpers import allPossibleShowNames +from sickbeard.helpers import sanitizeSceneName, custom_strftime from sickbeard.tv import TVShow class XEMBasicTests(test.SickbeardTestDBCase): @@ -49,8 +49,18 @@ class XEMBasicTests(test.SickbeardTestDBCase): def test_formating(self): self.loadFromDB() - show = sickbeard.helpers.findCertainShow(sickbeard.showList, 111051) - ep = show.getEpisode(2014, 34) + show = sickbeard.helpers.findCertainShow(sickbeard.showList, 24749) + ep = show.getEpisode(21, 17) + ep.airdate = datetime.datetime.now() + + search_string = {'Episode':[]} + episode = ep.airdate + str(episode).replace('-', '|') + ep_string = sanitizeSceneName(show.name) + ' ' + \ + str(episode).replace('-', '|') + '|' + \ + sickbeard.helpers.custom_strftime('%b', episode) + + search_string['Episode'].append(ep_string) scene_ep_string = sanitizeSceneName(show.name) + ' ' + \ sickbeard.config.naming_ep_type[2] % {'seasonnumber': ep.scene_season, @@ -69,12 +79,6 @@ class XEMBasicTests(test.SickbeardTestDBCase): print('Scene season search strings: %s' % (scene_season_string)) - def test_renaming(self): - self.file_name = 'American Pickers - S04E01 - Jurassic Pick.avi' - orig_extension = self.file_name.rpartition('.')[-1] - new_base_name = os.path.basename(proper_path) - new_file_name = new_base_name + '.' + orig_extension - if __name__ == "__main__": print "==================" print "STARTING - XEM Scene Numbering TESTS"