Fix queue tables displaying intervals greater than 24 hours

This commit is contained in:
JonnyWong16 2019-04-27 17:03:04 -07:00
commit 87a77f0522

View file

@ -1,5 +1,6 @@
<% <%
import arrow import datetime
from plexpy import helpers
from plexpy.activity_handler import ACTIVITY_SCHED, schedule_callback from plexpy.activity_handler import ACTIVITY_SCHED, schedule_callback
if queue == 'active sessions': if queue == 'active sessions':
@ -44,12 +45,12 @@
% for job in scheduled_jobs: % for job in scheduled_jobs:
<% <%
sched_job = ACTIVITY_SCHED.get_job(job) sched_job = ACTIVITY_SCHED.get_job(job)
next_run_in = arrow.get(sched_job.next_run_time).timestamp - arrow.now().timestamp now = datetime.datetime.now(sched_job.next_run_time.tzinfo)
%> %>
<tr> <tr>
<td><strong>${title_format.format(*sched_job.args)}</strong></td> <td><strong>${title_format.format(*sched_job.args)}</strong></td>
<td>${arrow.get(next_run_in).format('HH:mm:ss')}</td> <td>${helpers.format_timedelta_Hms(sched_job.next_run_time - now)}</td>
<td>${arrow.get(sched_job.next_run_time).format('YYYY-MM-DD HH:mm:ss')}</td> <td>${sched_job.next_run_time.strftime('%Y-%m-%d %H:%M:%S')}</td>
</tr> </tr>
% endfor % endfor
% else: % else: