From 99e395ddfa41a67ddb4594ebbfb2e31c21f185d6 Mon Sep 17 00:00:00 2001
From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
Date: Sun, 5 Jul 2020 20:39:31 -0700
Subject: [PATCH] Update scheduled tasks table
* Tautulli/Tautulli-Issues#251
---
data/interfaces/default/scheduler_table.html | 4 ++--
plexpy/common.py | 23 ++++++++++----------
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/data/interfaces/default/scheduler_table.html b/data/interfaces/default/scheduler_table.html
index 7cfe3cf3..583a03cb 100644
--- a/data/interfaces/default/scheduler_table.html
+++ b/data/interfaces/default/scheduler_table.html
@@ -28,7 +28,7 @@ DOCUMENTATION :: END
- % for job in common.SCHEDULER_LIST:
+ % for job, job_type in common.SCHEDULER_LIST.items():
% if job in scheduled_jobs:
<%
sched_job = plexpy.SCHED.get_job(job)
@@ -41,7 +41,7 @@ DOCUMENTATION :: END
${helpers.format_timedelta_Hms(sched_job.next_run_time - now)} |
${sched_job.next_run_time.astimezone(plexpy.SYS_TIMEZONE).strftime('%Y-%m-%d %H:%M:%S')} |
- % elif job in ('Check for server response', 'Check for active sessions', 'Check for recently added items') and plexpy.WS_CONNECTED:
+ % elif job_type == 'websocket' and plexpy.WS_CONNECTED:
% if job == 'Check for active sessions':
${job} |
diff --git a/plexpy/common.py b/plexpy/common.py
index f2e5c661..1f8c45dd 100644
--- a/plexpy/common.py
+++ b/plexpy/common.py
@@ -216,18 +216,19 @@ EXTRA_TYPES = {
}
SCHEDULER_LIST = [
- 'Check GitHub for updates',
- 'Check for server response',
- 'Check for active sessions',
- 'Check for recently added items',
- 'Check for Plex updates',
- 'Check for Plex remote access',
- 'Refresh users list',
- 'Refresh libraries list',
- 'Refresh Plex server URLs',
- 'Backup Tautulli database',
- 'Backup Tautulli config'
+ ('Check GitHub for updates', 'websocket'),
+ ('Check for server response', 'websocket'),
+ ('Check for active sessions', 'websocket'),
+ ('Check for recently added items', 'websocket'),
+ ('Check for server remote access', 'websocket'),
+ ('Check for Plex updates', 'scheduled'),
+ ('Refresh users list', 'scheduled'),
+ ('Refresh libraries list', 'scheduled'),
+ ('Refresh Plex server URLs', 'scheduled'),
+ ('Backup Tautulli database', 'scheduled'),
+ ('Backup Tautulli config', 'scheduled')
]
+SCHEDULER_LIST = OrderedDict(SCHEDULER_LIST)
DATE_TIME_FORMATS = [
{