mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-05 19:08:02 -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()
|
raise exceptions.FailedProcessingFailed()
|
||||||
|
|
||||||
parser = NameParser(False)
|
parser = NameParser(False)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
parsed = parser.parse(releaseName)
|
parsed = parser.parse(releaseName)
|
||||||
except InvalidNameException:
|
except InvalidNameException:
|
||||||
@ -75,7 +76,9 @@ class FailedProcessor(object):
|
|||||||
logger.WARNING)
|
logger.WARNING)
|
||||||
raise exceptions.FailedProcessingFailed()
|
raise exceptions.FailedProcessingFailed()
|
||||||
|
|
||||||
|
# scene -> indexer numbering
|
||||||
parsed = parsed.convert(self._show_obj)
|
parsed = parsed.convert(self._show_obj)
|
||||||
|
|
||||||
segment = {parsed.season_number:[]}
|
segment = {parsed.season_number:[]}
|
||||||
for episode in parsed.episode_numbers:
|
for episode in parsed.episode_numbers:
|
||||||
epObj = self._show_obj.getEpisode(parsed.season_number, episode)
|
epObj = self._show_obj.getEpisode(parsed.season_number, episode)
|
||||||
|
@ -212,7 +212,6 @@ class FailedQueueItem(generic_queue.QueueItem):
|
|||||||
def execute(self):
|
def execute(self):
|
||||||
generic_queue.QueueItem.execute(self)
|
generic_queue.QueueItem.execute(self)
|
||||||
|
|
||||||
failed_episodes = []
|
|
||||||
for season in self.segment:
|
for season in self.segment:
|
||||||
epObj = self.segment[season]
|
epObj = self.segment[season]
|
||||||
|
|
||||||
@ -223,30 +222,27 @@ class FailedQueueItem(generic_queue.QueueItem):
|
|||||||
failed_history.logFailed(release)
|
failed_history.logFailed(release)
|
||||||
history.logFailed(epObj, release, provider)
|
history.logFailed(epObj, release, provider)
|
||||||
failed_history.revertEpisode(epObj)
|
failed_history.revertEpisode(epObj)
|
||||||
failed_episodes.append(epObj)
|
|
||||||
|
|
||||||
logger.log(
|
logger.log(
|
||||||
"Beginning failed download search for [" + epObj.prettyName() + "]")
|
"Beginning failed download search for [" + epObj.prettyName() + "]")
|
||||||
|
try:
|
||||||
|
searchResult = search.searchProviders(self.show, season, [epObj], True)
|
||||||
|
|
||||||
if len(failed_episodes):
|
# reset thread back to original name
|
||||||
try:
|
threading.currentThread().name = self.thread_name
|
||||||
searchResult = search.searchProviders(self.show, failed_episodes[0].season, failed_episodes, True)
|
|
||||||
|
|
||||||
# reset thread back to original name
|
if searchResult:
|
||||||
threading.currentThread().name = self.thread_name
|
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:
|
# give the CPU a break
|
||||||
for result in searchResult:
|
time.sleep(2)
|
||||||
# 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
|
else:
|
||||||
time.sleep(2)
|
logger.log(u"No episodes found to retry for failed downloads return from providers!")
|
||||||
|
except Exception, e:
|
||||||
else:
|
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||||
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()
|
self.finish()
|
Loading…
Reference in New Issue
Block a user