diff --git a/plexpy/config.py b/plexpy/config.py index f094e88e..7b583d8d 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -58,6 +58,7 @@ _CONFIG_DEFINITIONS = { 'PMS_LOGS_FOLDER': (str, 'PMS', ''), 'PMS_LOGS_LINE_CAP': (int, 'PMS', 1000), 'PMS_NAME': (str, 'PMS', ''), + 'PMS_NAME_OVERRIDE': (str, 'PMS', ''), 'PMS_PORT': (int, 'PMS', 32400), 'PMS_TOKEN': (str, 'PMS', ''), 'PMS_SSL': (int, 'PMS', 0), diff --git a/plexpy/helpers.py b/plexpy/helpers.py index 89b047fd..9cfb9c45 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -1773,3 +1773,7 @@ def check_watched(media_type, view_offset, duration, marker_credits_first=None, return view_offset >= min(threshold, marker_credits_first) else: return view_offset >= threshold + + +def pms_name(): + return plexpy.CONFIG.PMS_NAME_OVERRIDE or plexpy.CONFIG.PMS_NAME diff --git a/plexpy/newsletters.py b/plexpy/newsletters.py index fdc1c5a8..59663fe2 100644 --- a/plexpy/newsletters.py +++ b/plexpy/newsletters.py @@ -599,7 +599,7 @@ class Newsletter(object): base_url = helpers.get_plexpy_url() + '/newsletter/' parameters = { - 'server_name': plexpy.CONFIG.PMS_NAME, + 'server_name': helpers.pms_name(), 'start_date': self.start_date.format(date_format), 'end_date': self.end_date.format(date_format), 'current_year': self.start_date.year, diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 197314fc..86baac4d 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -951,7 +951,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m 'tautulli_remote': plexpy.CONFIG.GIT_REMOTE, 'tautulli_branch': plexpy.CONFIG.GIT_BRANCH, 'tautulli_commit': plexpy.CURRENT_VERSION, - 'server_name': plexpy.CONFIG.PMS_NAME, + 'server_name': helpers.pms_name(), 'server_ip': plexpy.CONFIG.PMS_IP, 'server_port': plexpy.CONFIG.PMS_PORT, 'server_url': plexpy.CONFIG.PMS_URL, @@ -1246,7 +1246,7 @@ def build_server_notify_params(notify_action=None, **kwargs): 'tautulli_remote': plexpy.CONFIG.GIT_REMOTE, 'tautulli_branch': plexpy.CONFIG.GIT_BRANCH, 'tautulli_commit': plexpy.CURRENT_VERSION, - 'server_name': plexpy.CONFIG.PMS_NAME, + 'server_name': helpers.pms_name(), 'server_ip': plexpy.CONFIG.PMS_IP, 'server_port': plexpy.CONFIG.PMS_PORT, 'server_url': plexpy.CONFIG.PMS_URL, diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 1a747be9..ecd33a60 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -2850,7 +2850,7 @@ class PLEXMOBILEAPP(Notifier): 'data': { 'provider': { 'identifier': plexpy.CONFIG.PMS_IDENTIFIER, - 'title': plexpy.CONFIG.PMS_NAME + 'title': helpers.pms_name() } } } diff --git a/plexpy/plextv.py b/plexpy/plextv.py index e7815756..8bab1d51 100644 --- a/plexpy/plextv.py +++ b/plexpy/plextv.py @@ -48,7 +48,7 @@ def get_server_resources(return_presence=False, return_server=False, return_info if not return_presence and not return_info: logger.info("Tautulli PlexTV :: Requesting resources for server...") - server = {'pms_name': plexpy.CONFIG.PMS_NAME, + server = {'pms_name': helpers.pms_name(), 'pms_version': plexpy.CONFIG.PMS_VERSION, 'pms_platform': plexpy.CONFIG.PMS_PLATFORM, 'pms_ip': plexpy.CONFIG.PMS_IP, diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 29e2d02a..dd0d4528 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -127,7 +127,7 @@ def serve_template(templatename, **kwargs): error_handler=mako_error_handler) http_root = plexpy.HTTP_ROOT - server_name = plexpy.CONFIG.PMS_NAME + server_name = helpers.pms_name() cache_param = '?' + (plexpy.CURRENT_VERSION or common.RELEASE) _session = get_session_info() @@ -213,7 +213,7 @@ class WebInterface(object): "pms_is_remote": plexpy.CONFIG.PMS_IS_REMOTE, "pms_ssl": plexpy.CONFIG.PMS_SSL, "pms_is_cloud": plexpy.CONFIG.PMS_IS_CLOUD, - "pms_name": plexpy.CONFIG.PMS_NAME, + "pms_name": helpers.pms_name(), "logging_ignore_interval": plexpy.CONFIG.LOGGING_IGNORE_INTERVAL } @@ -282,7 +282,7 @@ class WebInterface(object): config = { "home_sections": plexpy.CONFIG.HOME_SECTIONS, "home_refresh_interval": plexpy.CONFIG.HOME_REFRESH_INTERVAL, - "pms_name": plexpy.CONFIG.PMS_NAME, + "pms_name": helpers.pms_name(), "pms_is_cloud": plexpy.CONFIG.PMS_IS_CLOUD, "update_show_changelog": plexpy.CONFIG.UPDATE_SHOW_CHANGELOG, "first_run_complete": plexpy.CONFIG.FIRST_RUN_COMPLETE