mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-20 16:43:43 +00:00
Fixed failed download handling.
This commit is contained in:
parent
05dcdd72d7
commit
64b857ee57
1 changed files with 21 additions and 20 deletions
|
@ -216,34 +216,35 @@ class FailedQueueItem(generic_queue.QueueItem):
|
|||
|
||||
for season, episodes in self.segment.items():
|
||||
for epObj in episodes:
|
||||
logger.log(u"Marking episode as bad: [" + epObj.prettyName() + "]")
|
||||
failed_history.markFailed(epObj)
|
||||
|
||||
(release, provider) = failed_history.findRelease(epObj)
|
||||
if release:
|
||||
logger.log(u"Marking release as bad: " + release)
|
||||
failed_history.markFailed(epObj)
|
||||
failed_history.logFailed(release)
|
||||
history.logFailed(epObj, release, provider)
|
||||
failed_history.revertEpisode(epObj)
|
||||
|
||||
logger.log(
|
||||
"Beginning failed download search for [" + epObj.prettyName() + "]")
|
||||
try:
|
||||
searchResult = search.searchProviders(self.show, season, [epObj], True)
|
||||
failed_history.revertEpisode(epObj)
|
||||
logger.log("Beginning failed download search for [" + epObj.prettyName() + "]")
|
||||
|
||||
# reset thread back to original name
|
||||
threading.currentThread().name = self.thread_name
|
||||
try:
|
||||
searchResult = search.searchProviders(self.show, season, [epObj], True)
|
||||
|
||||
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)
|
||||
# reset thread back to original name
|
||||
threading.currentThread().name = self.thread_name
|
||||
|
||||
# give the CPU a break
|
||||
time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])
|
||||
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)
|
||||
|
||||
else:
|
||||
logger.log(u"No valid episode found to retry for [" + epObj.prettyName() + "]")
|
||||
except Exception, e:
|
||||
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||
# give the CPU a break
|
||||
time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])
|
||||
|
||||
else:
|
||||
logger.log(u"No valid episode found to retry for [" + epObj.prettyName() + "]")
|
||||
except Exception, e:
|
||||
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||
|
||||
self.finish()
|
Loading…
Reference in a new issue