<%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'}) %>

${_('Scheduler')}

% 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)) %> % if enabled: % else: % endif % if scheduler == 'BACKLOGSEARCHER': <% searchQueue = getattr(sickrage.app, 'search_queue') %> <% BLSinProgress = searchQueue.is_backlog_in_progress() %> <% del searchQueue %> % if BLSinProgress: % else: % try: % except Exception: % endtry % endif % else: % try: % except Exception: % endtry % endif % if job: <% cycleTime = (job.trigger.interval.microseconds + (job.trigger.interval.seconds + job.trigger.interval.days * 24 * 3600) * 10**6) / 10**6 %> % 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 %> % else: % endif % endif % endfor
${_('Scheduled Job')} ${_('Enabled')} ${_('Active')} ${_('Cycle Time')} ${_('Next Run')} ${_('Action')}
${schedulerName}${_('YES')}${_('NO')}${_('True')}${service.running}N/A${service.running}N/A${pretty_time_delta(cycleTime)}${pretty_time_delta(timeLeft)}

${_('Show Task Queue')}

% for task in sickrage.app.show_queue.tasks.copy().values(): % try: <% showindexer_id = task.indexer_id %> % except Exception: % endtry % try: <% showname = task.show_name %> % except Exception: % if task.action == ShowTaskActions.ADD: % else: % endif % endtry % if task.priority == TaskPriority.EXTREME: % elif task.priority == TaskPriority.HIGH: % elif task.priority == TaskPriority.NORMAL: % elif task.priority == TaskPriority.LOW: % else: % endif % endfor
${_('Show ID')} ${_('Show Name')} ${_('Task Status')} ${_('Task Priority')} ${_('Task Added')} ${_('Task Queue Type')}
${showindexer_id}${showname}${task.showDir}${TaskStatus(task.status).value.capitalize()}${_('EXTREME')}${_('HIGH')}${_('NORMAL')}${_('LOW')}${task.priority}${task.added.strftime(dateTimeFormat)} ${ShowTaskActions(task.action).value}

${_('Disk Space')}

% if sickrage.app.config.tv_download_dir: % if tvdirFree is not False: % else: % endif % endif % for cur_dir in rootDir: % if rootDir[cur_dir] is not False: % else: % endif % endfor
${_('Type')} ${_('Location')} ${_('Free space')}
${_('TV Download Directory')} ${sickrage.app.config.tv_download_dir}${tvdirFree}${_('Missing')}
${_('Media Root Directories')}${cur_dir}${rootDir[cur_dir]}${_('Missing')}