Skip to content

Commit

Permalink
Merge pull request #42 from pymedusa/back-commits
Browse files Browse the repository at this point in the history
Bring back some commits
  • Loading branch information
medariox committed Feb 27, 2016
2 parents 7ce37f3 + 5c09ce8 commit e1df51a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
3 changes: 1 addition & 2 deletions gui/slick/views/config_search.mako
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
</label>
</div>
<div class="field-pair">
<label>
<span class="component-title">Trackers list</span>
Expand Down Expand Up @@ -670,4 +669,4 @@
</form>
</div>
</div>
</%block>
</%block>
16 changes: 7 additions & 9 deletions sickbeard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
GIT_PATH = None
DEVELOPER = False

NEWS_URL = 'https://raw.githubusercontent.com/pymedusa/sickrage.github.io/master/sickrage-news/news.md'
NEWS_URL = 'https://api.pymedusa.com/news.md'
NEWS_LAST_READ = None
NEWS_LATEST = None
NEWS_UNREAD = 0
Expand Down Expand Up @@ -351,7 +351,6 @@
PLEX_CLIENT_HOST = None
PLEX_SERVER_USERNAME = None
PLEX_SERVER_PASSWORD = None
PLEX_SERVER_NO_AUTH = False

USE_PLEX_CLIENT = False
PLEX_CLIENT_USERNAME = None
Expand Down Expand Up @@ -605,7 +604,7 @@ def initialize(consoleLogging=True): # pylint: disable=too-many-locals, too-man
USE_KODI, KODI_ALWAYS_ON, KODI_NOTIFY_ONSNATCH, KODI_NOTIFY_ONDOWNLOAD, KODI_NOTIFY_ONSUBTITLEDOWNLOAD, KODI_UPDATE_FULL, KODI_UPDATE_ONLYFIRST, \
KODI_UPDATE_LIBRARY, KODI_HOST, KODI_USERNAME, KODI_PASSWORD, BACKLOG_FREQUENCY, \
USE_TRAKT, TRAKT_USERNAME, TRAKT_ACCESS_TOKEN, TRAKT_REFRESH_TOKEN, TRAKT_REMOVE_WATCHLIST, TRAKT_SYNC_WATCHLIST, TRAKT_REMOVE_SHOW_FROM_SICKRAGE, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktCheckerScheduler, TRAKT_USE_RECOMMENDED, TRAKT_SYNC, TRAKT_SYNC_REMOVE, TRAKT_DEFAULT_INDEXER, TRAKT_REMOVE_SERIESLIST, TRAKT_TIMEOUT, TRAKT_BLACKLIST_NAME, \
USE_PLEX_SERVER, PLEX_SERVER_NO_AUTH, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, USE_PLEX_CLIENT, PLEX_CLIENT_USERNAME, PLEX_CLIENT_PASSWORD, \
USE_PLEX_SERVER, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, USE_PLEX_CLIENT, PLEX_CLIENT_USERNAME, PLEX_CLIENT_PASSWORD, \
PLEX_SERVER_HOST, PLEX_SERVER_TOKEN, PLEX_CLIENT_HOST, PLEX_SERVER_USERNAME, PLEX_SERVER_PASSWORD, PLEX_SERVER_HTTPS, MIN_BACKLOG_FREQUENCY, SKIP_REMOVED_FILES, ALLOWED_EXTENSIONS, \
USE_EMBY, EMBY_HOST, EMBY_APIKEY, \
showUpdateScheduler, __INITIALIZED__, INDEXER_DEFAULT_LANGUAGE, EP_DEFAULT_DELETED_STATUS, LAUNCH_BROWSER, TRASH_REMOVE_SHOW, TRASH_ROTATE_LOGS, SORT_ARTICLE, \
Expand Down Expand Up @@ -1028,7 +1027,6 @@ def path_leaf(path):
PLEX_CLIENT_USERNAME = check_setting_str(CFG, 'Plex', 'plex_client_username', '', censor_log=True)
PLEX_CLIENT_PASSWORD = check_setting_str(CFG, 'Plex', 'plex_client_password', '', censor_log=True)
PLEX_SERVER_HTTPS = bool(check_setting_int(CFG, 'Plex', 'plex_server_https', 0))
PLEX_SERVER_NO_AUTH = bool(check_setting_int(CFG, 'Plex', 'plex_server_no_auth', 0))

USE_EMBY = bool(check_setting_int(CFG, 'Emby', 'use_emby', 0))
EMBY_HOST = check_setting_str(CFG, 'Emby', 'emby_host', '')
Expand Down Expand Up @@ -1473,11 +1471,12 @@ def path_leaf(path):
run_delay=update_interval)

# processors
update_interval = datetime.timedelta(minutes=AUTOPOSTPROCESSER_FREQUENCY)
autoPostProcesserScheduler = scheduler.Scheduler(auto_postprocessor.PostProcessor(),
cycleTime=datetime.timedelta(
minutes=AUTOPOSTPROCESSER_FREQUENCY),
cycleTime=update_interval,
threadName="POSTPROCESSER",
silent=not PROCESS_AUTOMATICALLY)
silent=not PROCESS_AUTOMATICALLY,
run_delay=update_interval)

traktCheckerScheduler = scheduler.Scheduler(traktChecker.TraktChecker(),
cycleTime=datetime.timedelta(hours=1),
Expand Down Expand Up @@ -1944,7 +1943,6 @@ def save_config(): # pylint: disable=too-many-statements, too-many-branches
new_config['Plex']['plex_client_host'] = PLEX_CLIENT_HOST
new_config['Plex']['plex_server_username'] = PLEX_SERVER_USERNAME
new_config['Plex']['plex_server_password'] = helpers.encrypt(PLEX_SERVER_PASSWORD, ENCRYPTION_VERSION)
new_config['Plex']['plex_server_no_auth'] = int(PLEX_SERVER_NO_AUTH)

new_config['Plex']['use_plex_client'] = int(USE_PLEX_CLIENT)
new_config['Plex']['plex_client_username'] = PLEX_CLIENT_USERNAME
Expand Down Expand Up @@ -2187,4 +2185,4 @@ def launchBrowser(protocol='http', startPort=None, web_root='/'):
try:
webbrowser.open(browserURL, 1, 1)
except Exception:
logger.log(u"Unable to launch a browser", logger.ERROR)
logger.log(u"Unable to launch a browser", logger.ERROR)
20 changes: 13 additions & 7 deletions sickbeard/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@
from tornado.web import RequestHandler, HTTPError, authenticated
from tornado.gen import coroutine
from tornado.ioloop import IOLoop
from tornado.concurrent import run_on_executor

from concurrent.futures import ThreadPoolExecutor
from tornado.process import cpu_count

from tornado.concurrent import run_on_executor

from mako.runtime import UNDEFINED

mako_lookup = None
Expand Down Expand Up @@ -255,7 +259,7 @@ def __init__(self, *args, **kwargs):
super(WebHandler, self).__init__(*args, **kwargs)
self.io_loop = IOLoop.current()

executor = ThreadPoolExecutor(50)
executor = ThreadPoolExecutor(cpu_count())

@authenticated
@coroutine
Expand Down Expand Up @@ -2234,7 +2238,7 @@ def __init__(self, *args, **kwargs):

def index(self):
try:
changes = helpers.getURL('https://raw.githubusercontent.com/pymedusa/sickrage.github.io/master/sickrage-news/CHANGES.md', session=requests.Session(), returns='text')
changes = helpers.getURL('https://api.pymedusa.com/changelog.md', session=requests.Session(), returns='text')
except Exception:
logger.log(u'Could not load changes from repo, giving a link!', logger.DEBUG)
changes = 'Could not load changes from the repo. [Click here for CHANGES.md](https://raw.githubusercontent.com/pymedusa/sickrage.github.io/master/sickrage-news/CHANGES.md)'
Expand Down Expand Up @@ -5227,7 +5231,7 @@ def clearerrors(self, level=logger.ERROR):

return self.redirect("/errorlogs/viewlog/")

def viewlog(self, minLevel=logger.INFO, logFilter="<NONE>", logSearch=None, maxLines=500):
def viewlog(self, minLevel=logger.INFO, logFilter="<NONE>", logSearch=None, maxLines=1000):

def Get_Data(Levelmin, data_in, lines_in, regex, Filter, Search, mlines):

Expand All @@ -5243,8 +5247,6 @@ def Get_Data(Levelmin, data_in, lines_in, regex, Filter, Search, mlines):
if match:
level = match.group(7)
logName = match.group(8)
if not sickbeard.DEBUG and (level == 'DEBUG' or level == 'DB'):
continue
if level not in logger.LOGGING_LEVELS:
lastLine = False
continue
Expand Down Expand Up @@ -5287,6 +5289,10 @@ def Get_Data(Levelmin, data_in, lines_in, regex, Filter, Search, mlines):
'SEARCHQUEUE-MANUAL': u'Search Queue (Manual)',
'SEARCHQUEUE-RETRY': u'Search Queue (Retry/Failed)',
'SEARCHQUEUE-RSS': u'Search Queue (RSS)',
'SHOWQUEUE-FORCE-UPDATE': u'Search Queue (Forced Update)',
'SHOWQUEUE-UPDATE': u'Search Queue (Update)',
'SHOWQUEUE-REFRESH': u'Search Queue (Refresh)',
'SHOWQUEUE-FORCE-REFRESH': u'Search Queue (Forced Refresh)',
'FINDPROPERS': u'Find Propers',
'POSTPROCESSER': u'Postprocesser',
'FINDSUBTITLES': u'Find Subtitles',
Expand Down Expand Up @@ -5326,4 +5332,4 @@ def submit_errors(self):
submitter_notification = ui.notifications.error if issue_id is None else ui.notifications.message
submitter_notification(submitter_result)

return self.redirect("/errorlogs/")
return self.redirect("/errorlogs/")

0 comments on commit e1df51a

Please sign in to comment.