mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 12:59:42 -07:00
Fix loading of scheduled tasks when tasks are disabled
This commit is contained in:
parent
a3af8ed362
commit
f1d44c051d
2 changed files with 3 additions and 6 deletions
|
@ -13,8 +13,6 @@ DOCUMENTATION :: END
|
||||||
import datetime
|
import datetime
|
||||||
import plexpy
|
import plexpy
|
||||||
from plexpy import common, helpers
|
from plexpy import common, helpers
|
||||||
|
|
||||||
scheduled_jobs = [j.id for j in plexpy.SCHED.get_jobs()]
|
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<table class="config-scheduler-table small-muted">
|
<table class="config-scheduler-table small-muted">
|
||||||
|
@ -29,16 +27,15 @@ DOCUMENTATION :: END
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
% for job, job_type in common.SCHEDULER_LIST.items():
|
% for job, job_type in common.SCHEDULER_LIST.items():
|
||||||
% if job in scheduled_jobs:
|
|
||||||
<%
|
<%
|
||||||
sched_job = plexpy.SCHED.get_job(job)
|
sched_job = plexpy.SCHED.get_job(job)
|
||||||
now = datetime.datetime.now(sched_job.next_run_time.tzinfo)
|
|
||||||
%>
|
%>
|
||||||
|
% if sched_job:
|
||||||
<tr>
|
<tr>
|
||||||
<td>${sched_job.id}</td>
|
<td>${sched_job.id}</td>
|
||||||
<td><i class="fa fa-sm fa-fw fa-check"></i> Active</td>
|
<td><i class="fa fa-sm fa-fw fa-check"></i> Active</td>
|
||||||
<td>${helpers.format_timedelta_Hms(sched_job.trigger.interval)}</td>
|
<td>${helpers.format_timedelta_Hms(sched_job.trigger.interval)}</td>
|
||||||
<td>${helpers.format_timedelta_Hms(sched_job.next_run_time - now)}</td>
|
<td>${helpers.format_timedelta_Hms(sched_job.next_run_time - datetime.datetime.now(sched_job.next_run_time.tzinfo))}</td>
|
||||||
<td>${sched_job.next_run_time.astimezone(plexpy.SYS_TIMEZONE).strftime('%Y-%m-%d %H:%M:%S')}</td>
|
<td>${sched_job.next_run_time.astimezone(plexpy.SYS_TIMEZONE).strftime('%Y-%m-%d %H:%M:%S')}</td>
|
||||||
</tr>
|
</tr>
|
||||||
% elif job_type == 'websocket' and plexpy.WS_CONNECTED:
|
% elif job_type == 'websocket' and plexpy.WS_CONNECTED:
|
||||||
|
|
|
@ -237,7 +237,7 @@ EXTRA_TYPES = {
|
||||||
}
|
}
|
||||||
|
|
||||||
SCHEDULER_LIST = [
|
SCHEDULER_LIST = [
|
||||||
('Check GitHub for updates', 'websocket'),
|
('Check GitHub for updates', 'scheduled'),
|
||||||
('Check for server response', 'websocket'),
|
('Check for server response', 'websocket'),
|
||||||
('Check for active sessions', 'websocket'),
|
('Check for active sessions', 'websocket'),
|
||||||
('Check for recently added items', 'websocket'),
|
('Check for recently added items', 'websocket'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue