%inherit file="../layouts/main.mako"/>
<%!
import datetime
import sickrage
from sickrage.core.queues import TaskStatus, TaskPriority
from sickrage.core.queues.show import ShowTaskActions
from sickrage.core.common import dateTimeFormat
from sickrage.core.helpers import pretty_time_delta
%>
<%block name="content">
<%
schedulers = {
_('Daily Search'): 'daily_searcher',
_('Backlog'): 'backlog_searcher',
_('Show Updater'): 'show_updater',
_('RSS Cache Updater'): 'rsscache_updater',
}
if sickrage.app.config.version_notify:
schedulers.update({_('Version Check'): 'version_updater'})
if sickrage.app.config.download_propers:
schedulers.update({_('Proper Finder'): 'proper_searcher'})
if sickrage.app.config.process_automatically:
schedulers.update({_('Post Processor'): 'auto_postprocessor'})
if sickrage.app.config.use_subtitles:
schedulers.update({_('Subtitles Finder'): 'subtitle_searcher'})
if sickrage.app.config.use_trakt:
schedulers.update({_('Trakt Checker'): 'trakt_searcher'})
%>
${_('Scheduled Job')} |
${_('Enabled')} |
${_('Active')} |
${_('Cycle Time')} |
${_('Next Run')} |
${_('Action')} |
% for schedulerName, scheduler in schedulers.items():
<% service = getattr(sickrage.app, scheduler) %>
<% job = sickrage.app.scheduler.get_job(service.name) %>
<% enabled = bool(getattr(job, 'next_run_time', False)) %>
${schedulerName} |
% if enabled:
${_('YES')} |
% else:
${_('NO')} |
% endif
% if scheduler == 'BACKLOGSEARCHER':
<% searchQueue = getattr(sickrage.app, 'search_queue') %>
<% BLSinProgress = searchQueue.is_backlog_in_progress() %>
<% del searchQueue %>
% if BLSinProgress:
${_('True')} |
% else:
% try:
${service.running} |
% except Exception:
N/A |
% endtry
% endif
% else:
% try:
${service.running} |
% except Exception:
N/A |
% endtry
% endif
% if job:
<% cycleTime = (job.trigger.interval.microseconds + (job.trigger.interval.seconds + job.trigger.interval.days * 24 * 3600) * 10**6) / 10**6 %>
${pretty_time_delta(cycleTime)} |
% if job.next_run_time:
<%
x = job.next_run_time - datetime.datetime.now(job.next_run_time.tzinfo)
timeLeft = (x.microseconds + (x.seconds + x.days * 24 * 3600) * 10**6) / 10**6
%>
${pretty_time_delta(timeLeft)} |
% else:
|
% endif
% endif
|
% endfor
${_('Show ID')} |
${_('Show Name')} |
${_('Task Status')} |
${_('Task Priority')} |
${_('Task Added')} |
${_('Task Queue Type')} |
% for task in sickrage.app.show_queue.tasks.copy().values():
% try:
<% showindexer_id = task.indexer_id %>
${showindexer_id} |
% except Exception:
|
% endtry
% try:
<% showname = task.show_name %>
${showname} |
% except Exception:
% if task.action == ShowTaskActions.ADD:
${task.showDir} |
% else:
|
% endif
% endtry
${TaskStatus(task.status).value.capitalize()} |
% if task.priority == TaskPriority.EXTREME:
${_('EXTREME')} |
% elif task.priority == TaskPriority.HIGH:
${_('HIGH')} |
% elif task.priority == TaskPriority.NORMAL:
${_('NORMAL')} |
% elif task.priority == TaskPriority.LOW:
${_('LOW')} |
% else:
${task.priority} |
% endif
${task.added.strftime(dateTimeFormat)} |
${ShowTaskActions(task.action).value} |
% endfor
${_('Type')} |
${_('Location')} |
${_('Free space')} |
% if sickrage.app.config.tv_download_dir:
${_('TV Download Directory')} |
${sickrage.app.config.tv_download_dir} |
% if tvdirFree is not False:
${tvdirFree} |
% else:
${_('Missing')} |
% endif
% endif
${_('Media Root Directories')} |
% for cur_dir in rootDir:
${cur_dir} |
% if rootDir[cur_dir] is not False:
${rootDir[cur_dir]} |
% else:
${_('Missing')} |
% endif
% endfor
%block>