1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Added user settable interval for autoPost-Processing to post-processing config section.

This commit is contained in:
echel0n 2014-05-21 13:26:24 -07:00
parent 95adb131e1
commit 13462fbb67
4 changed files with 36 additions and 10 deletions

View File

@ -152,6 +152,17 @@
</label>
</div>
<div class="field-pair">
<label class="nocheck clearfix">
<span class="component-title">Auto Post-Processing Frequency</span>
<input type="text" name="autopostprocesser_frequency" id="autopostprocesser_frequency" value="$sickbeard.AUTOPOSTPROCESSER_FREQUENCY" size="5" />
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">Time in minutes to check for new files to auto post-process (eg. 10)</span>
</label>
</div>
<div class="field-pair">
<input id="unpack" type="checkbox" name="unpack" #if $sickbeard.UNPACK == True then "checked=\"checked\"" else ""# />
<label class="clearfix" for="unpack">

View File

@ -24,8 +24,8 @@ import sqlite3
import datetime
import socket
import os, sys, subprocess, re
import urllib
from urllib2 import getproxies
from threading import Lock
# apparently py2exe won't build these unless they're imported somewhere
@ -45,8 +45,7 @@ from sickbeard import scene_numbering, scene_exceptions, name_cache
from indexers.indexer_api import indexerApi
from indexers.indexer_exceptions import indexer_shownotfound, indexer_exception, indexer_error, indexer_episodenotfound, \
indexer_attributenotfound, indexer_seasonnotfound, indexer_userabort, indexerExcepts
from common import SD, SKIPPED, NAMING_REPEAT
from sickbeard.common import SD, SKIPPED, NAMING_REPEAT
from sickbeard.databases import mainDB, cache_db, failed_db
@ -183,15 +182,18 @@ DOWNLOAD_PROPERS = None
CHECK_PROPERS_INTERVAL = None
ALLOW_HIGH_PRIORITY = None
AUTOPOSTPROCESSER_FREQUENCY = None
DAILYSEARCH_FREQUENCY = None
UPDATE_FREQUENCY = None
BACKLOG_FREQUENCY = None
DAILYSEARCH_STARTUP = None
BACKLOG_STARTUP = None
MIN_AUTOPOSTPROCESSER_FREQUENCY = 1
MIN_BACKLOG_FREQUENCY = 10
MIN_DAILYSEARCH_FREQUENCY = 10
MIN_UPDATE_FREQUENCY = 1
DEFAULT_AUTOPOSTPROCESSER_FREQUENCY = 10
DEFAULT_BACKLOG_FREQUENCY = 10080
DEFAULT_DAILYSEARCH_FREQUENCY = 60
DEFAULT_UPDATE_FREQUENCY = 1
@ -457,7 +459,8 @@ def initialize(consoleLogging=True):
GUI_NAME, HOME_LAYOUT, HISTORY_LAYOUT, DISPLAY_SHOW_SPECIALS, COMING_EPS_LAYOUT, COMING_EPS_SORT, COMING_EPS_DISPLAY_PAUSED, COMING_EPS_MISSED_RANGE, DATE_PRESET, TIME_PRESET, TIME_PRESET_W_SECONDS, \
METADATA_WDTV, METADATA_TIVO, METADATA_MEDE8ER, IGNORE_WORDS, CALENDAR_UNPROTECTED, CREATE_MISSING_SHOW_DIRS, \
ADD_SHOWS_WO_DIR, USE_SUBTITLES, SUBTITLES_LANGUAGES, SUBTITLES_DIR, SUBTITLES_SERVICES_LIST, SUBTITLES_SERVICES_ENABLED, SUBTITLES_HISTORY, SUBTITLES_FINDER_FREQUENCY, subtitlesFinderScheduler, \
USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING
USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING, \
AUTOPOSTPROCESSER_FREQUENCY, DEFAULT_AUTOPOSTPROCESSER_FREQUENCY, MIN_AUTOPOSTPROCESSER_FREQUENCY
if __INITIALIZED__:
return False
@ -555,7 +558,7 @@ def initialize(consoleLogging=True):
if not re.match(r'\d+\|[^|]+(?:\|[^|]+)*', ROOT_DIRS):
ROOT_DIRS = ''
proxies = urllib.getproxies()
proxies = getproxies()
proxy_url = None
if 'http' in proxies:
proxy_url = proxies['http']
@ -606,6 +609,11 @@ def initialize(consoleLogging=True):
USENET_RETENTION = check_setting_int(CFG, 'General', 'usenet_retention', 500)
AUTOPOSTPROCESSER_FREQUENCY = check_setting_int(CFG, 'General', 'dailysearch_frequency',
DEFAULT_AUTOPOSTPROCESSER_FREQUENCY)
if AUTOPOSTPROCESSER_FREQUENCY < MIN_AUTOPOSTPROCESSER_FREQUENCY:
AUTOPOSTPROCESSER_FREQUENCY = MIN_AUTOPOSTPROCESSER_FREQUENCY
DAILYSEARCH_FREQUENCY = check_setting_int(CFG, 'General', 'dailysearch_frequency',
DEFAULT_DAILYSEARCH_FREQUENCY)
if DAILYSEARCH_FREQUENCY < MIN_DAILYSEARCH_FREQUENCY:
@ -936,7 +944,7 @@ def initialize(consoleLogging=True):
properFinderScheduler.silent = True
autoPostProcesserScheduler = scheduler.Scheduler(autoPostProcesser.PostProcesser(),
cycleTime=datetime.timedelta(minutes=10),
cycleTime=datetime.timedelta(minutes=AUTOPOSTPROCESSER_FREQUENCY),
threadName="POSTPROCESSER",
runImmediately=True)
if not PROCESS_AUTOMATICALLY:
@ -1338,6 +1346,7 @@ def save_config():
new_config['General']['nzb_method'] = NZB_METHOD
new_config['General']['torrent_method'] = TORRENT_METHOD
new_config['General']['usenet_retention'] = int(USENET_RETENTION)
new_config['General']['autopostprocesser_frequency'] = int(AUTOPOSTPROCESSER_FREQUENCY)
new_config['General']['dailysearch_frequency'] = int(DAILYSEARCH_FREQUENCY)
new_config['General']['backlog_frequency'] = int(BACKLOG_FREQUENCY)
new_config['General']['update_frequency'] = int(UPDATE_FREQUENCY)

View File

@ -157,6 +157,14 @@ def change_TV_DOWNLOAD_DIR(tv_download_dir):
return True
def change_AUTOPOSTPROCESSER_FREQUENCY(freq):
sickbeard.AUTOPOSTPROCESSER_FREQUENCY = to_int(freq, default=sickbeard.DEFAULT_AUTOPOSTPROCESSER_FREQUENCY)
if sickbeard.AUTOPOSTPROCESSER_FREQUENCY < sickbeard.MIN_AUTOPOSTPROCESSER_FREQUENCY:
sickbeard.AUTOPOSTPROCESSER_FREQUENCY = sickbeard.MIN_AUTOPOSTPROCESSER_FREQUENCY
sickbeard.autoPostProcesserScheduler.cycleTime = datetime.timedelta(minutes=sickbeard.AUTOPOSTPROCESSER_FREQUENCY)
def change_DAILYSEARCH_FREQUENCY(freq):
sickbeard.DAILYSEARCH_FREQUENCY = to_int(freq, default=sickbeard.DEFAULT_DAILYSEARCH_FREQUENCY)

View File

@ -26,10 +26,7 @@ import re
import threading
import datetime
import random
import locale
import logging
import itertools
import operator
from Cheetah.Template import Template
import cherrypy
@ -1192,7 +1189,7 @@ class ConfigPostProcessing:
move_associated_files=None, tv_download_dir=None, naming_custom_abd=None,
naming_abd_pattern=None, naming_strip_year=None, use_failed_downloads=None,
delete_failed=None, extra_scripts=None, skip_removed_files=None,
naming_custom_sports=None, naming_sports_pattern=None):
naming_custom_sports=None, naming_sports_pattern=None, autopostprocesser_frequency=None):
results = []
@ -1200,6 +1197,7 @@ class ConfigPostProcessing:
results += ["Unable to create directory " + os.path.normpath(tv_download_dir) + ", dir not changed."]
sickbeard.PROCESS_AUTOMATICALLY = config.checkbox_to_value(process_automatically)
config.change_AUTOPOSTPROCESSER_FREQUENCY(autopostprocesser_frequency)
if sickbeard.PROCESS_AUTOMATICALLY:
sickbeard.autoPostProcesserScheduler.silent = False