mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Fix for air-by-date issues
This commit is contained in:
parent
2a5cd9b02e
commit
28d39df816
@ -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)):
|
||||
|
@ -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)):
|
||||
|
@ -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)):
|
||||
|
@ -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)):
|
||||
|
@ -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)):
|
||||
|
@ -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)):
|
||||
|
@ -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)):
|
||||
|
@ -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)):
|
||||
|
@ -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)):
|
||||
|
@ -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)):
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user