1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00

Fxi for failed downloads

This commit is contained in:
echel0n 2014-05-19 10:53:47 -07:00
parent 854de69683
commit a12085cbfc
2 changed files with 18 additions and 19 deletions

View File

@ -53,6 +53,7 @@ class FailedProcessor(object):
raise exceptions.FailedProcessingFailed()
parser = NameParser(False)
try:
parsed = parser.parse(releaseName)
except InvalidNameException:
@ -75,7 +76,9 @@ class FailedProcessor(object):
logger.WARNING)
raise exceptions.FailedProcessingFailed()
# scene -> indexer numbering
parsed = parsed.convert(self._show_obj)
segment = {parsed.season_number:[]}
for episode in parsed.episode_numbers:
epObj = self._show_obj.getEpisode(parsed.season_number, episode)

View File

@ -212,7 +212,6 @@ class FailedQueueItem(generic_queue.QueueItem):
def execute(self):
generic_queue.QueueItem.execute(self)
failed_episodes = []
for season in self.segment:
epObj = self.segment[season]
@ -223,30 +222,27 @@ class FailedQueueItem(generic_queue.QueueItem):
failed_history.logFailed(release)
history.logFailed(epObj, release, provider)
failed_history.revertEpisode(epObj)
failed_episodes.append(epObj)
logger.log(
"Beginning failed download search for [" + epObj.prettyName() + "]")
try:
searchResult = search.searchProviders(self.show, season, [epObj], True)
if len(failed_episodes):
try:
searchResult = search.searchProviders(self.show, failed_episodes[0].season, failed_episodes, True)
# reset thread back to original name
threading.currentThread().name = self.thread_name
# reset thread back to original name
threading.currentThread().name = self.thread_name
if searchResult:
for result in searchResult:
# just use the first result for now
logger.log(u"Downloading " + result.name + " from " + result.provider.name)
search.snatchEpisode(result)
if searchResult:
for result in searchResult:
# just use the first result for now
logger.log(u"Downloading " + result.name + " from " + result.provider.name)
search.snatchEpisode(result)
# give the CPU a break
time.sleep(2)
# give the CPU a break
time.sleep(2)
else:
logger.log(u"No episodes found to retry for failed downloads return from providers!")
except Exception, e:
logger.log(traceback.format_exc(), logger.DEBUG)
else:
logger.log(u"No episodes found to retry for failed downloads return from providers!")
except Exception, e:
logger.log(traceback.format_exc(), logger.DEBUG)
self.finish()