Merge branch 'nightly' into python3

# Conflicts:
#	plexpy/webserve.py
This commit is contained in:
JonnyWong16 2020-01-20 20:55:30 -08:00
commit b39ac866f2
12 changed files with 23 additions and 16 deletions

View file

@ -71,7 +71,7 @@ SYS_LANGUAGE = None
SYS_ENCODING = None
QUIET = False
VERBOSE = True
VERBOSE = False
DAEMON = False
CREATEPID = False
PIDFILE = None
@ -128,6 +128,7 @@ def initialize(config_file):
global CONFIG
global CONFIG_FILE
global VERBOSE
global _INITIALIZED
global CURRENT_VERSION
global LATEST_VERSION
@ -157,6 +158,8 @@ def initialize(config_file):
if not log_writable and not QUIET:
sys.stderr.write("Unable to create the log directory. Logging to screen only.\n")
VERBOSE = VERBOSE or bool(CONFIG.VERBOSE_LOGS)
# Start the logger, disable console if needed
logger.initLogger(console=not QUIET, log_dir=CONFIG.LOG_DIR if log_writable else None,
verbose=VERBOSE)

View file

@ -608,6 +608,7 @@ _CONFIG_DEFINITIONS = {
'UPDATE_LABELS': (int, 'General', 1),
'UPDATE_LIBRARIES_DB_NOTIFY': (int, 'General', 1),
'UPDATE_NOTIFIERS_DB': (int, 'General', 1),
'VERBOSE_LOGS': (int, 'Advanced', 1),
'VERIFY_SSL_CERT': (bool_int, 'Advanced', 1),
'VIDEO_LOGGING_ENABLE': (int, 'Monitoring', 1),
'WEBSOCKET_MONITOR_PING_PONG': (int, 'Advanced', 0),

View file

@ -3366,7 +3366,7 @@ class TELEGRAM(Notifier):
if len(text) > 1024:
data['disable_notification'] = True
else:
data['caption'] = text
data['caption'] = text.encode('utf-8')
r = self.make_request('https://api.telegram.org/bot{}/sendPhoto'.format(self.config['bot_token']),
data=data, files=files)
@ -3374,7 +3374,7 @@ class TELEGRAM(Notifier):
if not data.pop('disable_notification', None):
return r
data['text'] = text
data['text'] = (text[:4093] + (text[4093:] and '...')).encode('utf-8')
if self.config['disable_web_preview']:
data['disable_web_page_preview'] = True

View file

@ -2678,8 +2678,11 @@ class WebInterface(object):
@requireAuth(member_of("admin"))
def toggleVerbose(self, **kwargs):
plexpy.VERBOSE = not plexpy.VERBOSE
logger.initLogger(console=not plexpy.QUIET,
log_dir=plexpy.CONFIG.LOG_DIR, verbose=plexpy.VERBOSE)
plexpy.CONFIG.__setattr__('VERBOSE_LOGS', plexpy.VERBOSE)
plexpy.CONFIG.write()
logger.initLogger(console=not plexpy.QUIET, log_dir=plexpy.CONFIG.LOG_DIR, verbose=plexpy.VERBOSE)
logger.info("Verbose toggled, set to %s", plexpy.VERBOSE)
logger.debug("If you read this message, debug logging is available")
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "logs")