Commit 5b77ccc7 authored by echel0n's avatar echel0n

Fixed #SICKRAGE-APP-5GG and #SICKRAGE-APP-5GF - TypeError sickrage.providers...

Fixed #SICKRAGE-APP-5GG and #SICKRAGE-APP-5GF - TypeError sickrage.providers in find_search_results, 'method' object is not subscriptable
Fixed #SICKRAGE-APP-5GC - AttributeError enum in __getattr__
Fixed #SICKRAGE-APP-5GH - AttributeError sickrage.core.webserver.handlers.root in handle_get, 'NoneType' object has no attribute 'modify'
Added error logging for failed queue tasks
parent 53a787fe
......@@ -256,6 +256,8 @@ class Queue(object):
if task_id in self.tasks:
sickrage.app.log.debug("Removing {} task {}".format(self.name, task_id))
task = self.tasks.get(task_id)
if task.status == TaskStatus.FAILED:
sickrage.app.log.error("{} task {} failed: {}".format(self.name, task_id, task.error_message))
if task in self.queue:
self.queue.remove(self.tasks.get(task_id))
del self.tasks[task_id]
......
......@@ -1346,8 +1346,9 @@ class SyncTraktHandler(BaseHandler, ABC):
sickrage.app.alerts.message(_('Syncing Trakt with SiCKRAGE'))
job = sickrage.app.scheduler.get_job(sickrage.app.trakt_searcher.name)
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
if job:
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
return self.redirect("/home/")
......
......@@ -61,8 +61,9 @@ class ForceBacklogSearchHandler(BaseHandler, ABC):
sickrage.app.alerts.message(_('Backlog search started'))
job = sickrage.app.scheduler.get_job(sickrage.app.backlog_searcher.name)
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
if job:
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
return self.redirect("/manage/manageQueues/")
......@@ -78,8 +79,9 @@ class ForceDailySearchHandler(BaseHandler, ABC):
sickrage.app.alerts.message(_('Daily search started'))
job = sickrage.app.scheduler.get_job(sickrage.app.daily_searcher.name)
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
if job:
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
return self.redirect("/manage/manageQueues/")
......@@ -95,8 +97,9 @@ class ForceFindPropersHandler(BaseHandler, ABC):
sickrage.app.alerts.message(_('Find propers search started'))
job = sickrage.app.scheduler.get_job(sickrage.app.proper_searcher.name)
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
if job:
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
return self.redirect("/manage/manageQueues/")
......
......@@ -312,5 +312,6 @@ class ForceSchedulerJobHandler(BaseHandler, ABC):
service = getattr(sickrage.app, name, None)
if service:
job = sickrage.app.scheduler.get_job(service.name)
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
if job:
job.modify(next_run_time=datetime.datetime.utcnow(), kwargs={'force': True})
sickrage.app.wserver.io_loop.add_timeout(datetime.timedelta(seconds=10), job.modify, kwargs={})
......@@ -160,7 +160,7 @@
<td>${task.priority}</td>
% endif
<td>${task.added.strftime(dateTimeFormat)}</td>
<td>${ShowTaskActions.names[task.action_id]}</td>
<td>${ShowTaskActions(task.action_id).value}</td>
</tr>
% endfor
</tbody>
......
......@@ -360,13 +360,13 @@ class GenericProvider(object):
sickrage.app.log.debug("This is supposed to be a season pack search but the result {} is not "
"a valid season pack, skipping it".format(provider_result.name))
continue
elif parse_result.season_number != episode_object.get_season_episode_numbering[0]:
elif parse_result.season_number != episode_object.get_season_episode_numbering()[0]:
sickrage.app.log.debug("This season result {} is for a season we are not searching for, skipping it".format(provider_result.name))
continue
else:
if not all([parse_result.season_number is not None, parse_result.episode_numbers,
parse_result.season_number == episode_object.get_season_episode_numbering[0],
episode_object.get_season_episode_numbering[1] in parse_result.episode_numbers]):
parse_result.season_number == episode_object.get_season_episode_numbering()[0],
episode_object.get_season_episode_numbering()[1] in parse_result.episode_numbers]):
sickrage.app.log.debug("The result {} doesn't seem to be a valid episode "
"that we are trying to snatch, ignoring".format(provider_result.name))
continue
......
Markdown is supported
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