mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Fxi for failed downloads
This commit is contained in:
parent
854de69683
commit
a12085cbfc
@ -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)
|
||||
|
@ -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()
|
Loading…
Reference in New Issue
Block a user