From 83b97111a0b3b974d7b7c601fe944d34ed72256a Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Mon, 9 May 2016 18:28:39 -0700 Subject: [PATCH] Add PMS http request timeout an advanced setting in config file --- plexpy/config.py | 1 + plexpy/http_handler.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plexpy/config.py b/plexpy/config.py index 2604735b..790c4688 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -47,6 +47,7 @@ _CONFIG_DEFINITIONS = { 'PMS_URL': (str, 'PMS', ''), 'PMS_USE_BIF': (int, 'PMS', 0), 'PMS_UUID': (str, 'PMS', ''), + 'PMS_TIMEOUT': (int, 'Advanced', 15), 'TIME_FORMAT': (str, 'General', 'HH:mm'), 'ANON_REDIRECT': (str, 'General', 'http://dereferer.org/?'), 'API_ENABLED': (int, 'General', 0), diff --git a/plexpy/http_handler.py b/plexpy/http_handler.py index 89606362..f9da4a28 100644 --- a/plexpy/http_handler.py +++ b/plexpy/http_handler.py @@ -48,7 +48,10 @@ class HTTPHandler(object): output_format='raw', return_type=False, no_token=False, - timeout=20): + timeout=None): + + if timeout is None: + timeout = plexpy.CONFIG.PMS_TIMEOUT valid_request_types = ['GET', 'POST', 'PUT', 'DELETE']