Commit 9d880bd1 authored by echel0n's avatar echel0n
Browse files

Failed processing skips paused shows and archived episodes.

Fixed issue with failed downloads history view when history item's provider is no longer enabled or present.
parent fbc88147
# Changelog
- * 313bbde - 2018-08-30: Removed unrequired logging from AniDB module
- * 64749ef - 2018-08-30: Failed processing skips paused shows and archived episodes.
- * fbc8814 - 2018-08-30: Removed unrequired logging from AniDB module
- * dc90396 - 2018-08-29: Release v9.3.64
- * 0c2e95d - 2018-08-27: Release v9.3.63
- * 9e66cf5 - 2018-08-27: Fixed javascript issue when adding existing shows
......
......@@ -19,6 +19,7 @@
from __future__ import print_function, unicode_literals
import sickrage
from sickrage.core.common import Quality
from sickrage.core.exceptions import FailedPostProcessingFailedException
from sickrage.core.helpers import show_names
from sickrage.core.nameparser import InvalidNameException, InvalidShowException, \
......@@ -47,19 +48,23 @@ class FailedProcessor(object):
"""
self._log("Failed download detected: (" + str(self.nzb_name) + ", " + str(self.dir_name) + ")")
releaseName = show_names.determineReleaseName(self.dir_name, self.nzb_name)
if releaseName is None:
release_name = show_names.determineReleaseName(self.dir_name, self.nzb_name)
if release_name is None:
self._log("Warning: unable to find a valid release name.", sickrage.app.log.WARNING)
raise FailedPostProcessingFailedException()
try:
parser = NameParser(False)
parsed = parser.parse(releaseName)
parsed = NameParser(False).parse(release_name)
except InvalidNameException:
self._log("Error: release name is invalid: " + releaseName, sickrage.app.log.DEBUG)
self._log("Error: release name is invalid: " + release_name, sickrage.app.log.DEBUG)
raise FailedPostProcessingFailedException()
except InvalidShowException:
self._log("Error: unable to parse release name " + releaseName + " into a valid show",
self._log("Error: unable to parse release name " + release_name + " into a valid show",
sickrage.app.log.DEBUG)
raise FailedPostProcessingFailedException()
if parsed.show.paused:
self._log("Warning: skipping failed processing for {} because the show is paused".format(release_name),
sickrage.app.log.DEBUG)
raise FailedPostProcessingFailedException()
......@@ -72,8 +77,11 @@ class FailedProcessor(object):
sickrage.app.log.debug(" - " + str(parsed.air_date))
for episode in parsed.episode_numbers:
sickrage.app.search_queue.put(
FailedQueueItem(parsed.show, [parsed.show.getEpisode(parsed.season_number, episode)]))
segment = parsed.show.getEpisode(parsed.season_number, episode)
if segment.status in Quality.ARCHIVED:
continue
sickrage.app.search_queue.put(FailedQueueItem(parsed.show, [segment]))
return True
......
......@@ -235,26 +235,25 @@ class BacklogQueueItem(srQueueItem):
def run(self):
self.started = True
if not self.show.paused:
try:
sickrage.app.log.info("Starting backlog search for: [" + self.show.name + "]")
search_result = searchProviders(self.show, self.segment, manualSearch=False, updateCache=False)
if search_result:
for result in search_result:
# just use the first result for now
sickrage.app.log.info("Downloading " + result.name + " from " + result.provider.name)
snatchEpisode(result)
# give the CPU a break
time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
else:
sickrage.app.log.info(
"No needed episodes found during backlog search for: [" + self.show.name + "]")
except Exception:
sickrage.app.log.debug(traceback.format_exc())
finally:
sickrage.app.log.info("Finished backlog search for: [" + self.show.name + "]")
try:
sickrage.app.log.info("Starting backlog search for: [" + self.show.name + "]")
search_result = searchProviders(self.show, self.segment, manualSearch=False, updateCache=False)
if search_result:
for result in search_result:
# just use the first result for now
sickrage.app.log.info("Downloading " + result.name + " from " + result.provider.name)
snatchEpisode(result)
# give the CPU a break
time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
else:
sickrage.app.log.info(
"No needed episodes found during backlog search for: [" + self.show.name + "]")
except Exception:
sickrage.app.log.debug(traceback.format_exc())
finally:
sickrage.app.log.info("Finished backlog search for: [" + self.show.name + "]")
class FailedQueueItem(srQueueItem):
......@@ -278,6 +277,7 @@ class FailedQueueItem(srQueueItem):
sickrage.app.log.info("Marking episode as bad: [" + epObj.pretty_name() + "]")
FailedHistory.markFailed(epObj)
(release, provider) = FailedHistory.findFailedRelease(epObj)
if release:
FailedHistory.logFailed(release)
......
......@@ -52,12 +52,14 @@
% endif
</td>
<td class="table-fit">
% if hItem["provider"].lower() in sickrage.app.search_providers.all():
<% provider = sickrage.app.search_providers.all()[hItem["provider"].lower()] %>
% if provider is not None:
<i class="sickrage-providers sickrage-providers-${provider.id}"
title="${provider.name}"></i>
title="${provider.name}"
style="vertical-align:middle;cursor: help;"></i>
% else:
<i class="sickrage-providers sickrage-providers-missing"
style="vertical-align:middle;"
title="${_('missing provider')}"></i>
% endif
</td>
......@@ -69,7 +71,7 @@
</tbody>
</table>
</div>
<input type="button" class="btn" value="${_('Submit')}"
<input type="button" class="btn" value="${_('Clear')}"
id="submitMassRemove">
</div>
</div>
......
......@@ -119,8 +119,7 @@ class AniDBLink(threading.Thread):
if resp.rescode in ('200', '201'):
self.session = resp.attrs['sesskey']
if resp.rescode in ('209',):
print "sorry encryption is not supported"
raise
raise Exception, "sorry encryption is not supported"
#self.crypt=aes(md5(resp.req.apipassword+resp.attrs['salt']).digest())
if resp.rescode in ('203', '403', '500', '501', '503', '506'):
self.session = None
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment