Add option to override Plex Web URL

This commit is contained in:
JonnyWong16 2017-12-09 23:08:52 -08:00
parent b76143116c
commit 1b5e5f37d0
5 changed files with 23 additions and 6 deletions

View file

@ -63,6 +63,7 @@ _CONFIG_DEFINITIONS = {
'PMS_UPDATE_CHANNEL': (str, 'PMS', 'public'),
'PMS_UPDATE_DISTRO': (str, 'PMS', ''),
'PMS_UPDATE_DISTRO_BUILD': (str, 'PMS', ''),
'PMS_WEB_URL': (str, 'PMS', 'https://app.plex.tv/desktop'),
'TIME_FORMAT': (str, 'General', 'HH:mm'),
'ANON_REDIRECT': (str, 'General', 'http://www.nullrefer.com/?'),
'API_ENABLED': (int, 'General', 0),

View file

@ -500,8 +500,10 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m
remaining_duration = duration - view_offset
# Build Plex URL
metadata['plex_url'] = 'https://app.plex.tv/desktop#!/server/{0}/details?key=%2Flibrary%2Fmetadata%2F{1}'.format(
plexpy.CONFIG.PMS_IDENTIFIER, str(rating_key))
metadata['plex_url'] = '{web_url}#!/server/{pms_identifier}/details?key=%2Flibrary%2Fmetadata%2F{rating_key}'.format(
web_url=plexpy.CONFIG.PMS_WEB_URL or 'https://app.plex.tv/desktop',
pms_identifier=plexpy.CONFIG.PMS_IDENTIFIER,
rating_key=rating_key)
# Get media IDs from guid and build URLs
if 'imdb://' in metadata['guid']:

View file

@ -2624,6 +2624,7 @@ class WebInterface(object):
"pms_url_manual": checked(plexpy.CONFIG.PMS_URL_MANUAL),
"pms_use_bif": checked(plexpy.CONFIG.PMS_USE_BIF),
"pms_uuid": plexpy.CONFIG.PMS_UUID,
"pms_web_url": plexpy.CONFIG.PMS_WEB_URL,
"date_format": plexpy.CONFIG.DATE_FORMAT,
"time_format": plexpy.CONFIG.TIME_FORMAT,
"week_start_monday": checked(plexpy.CONFIG.WEEK_START_MONDAY),
@ -3608,7 +3609,8 @@ class WebInterface(object):
metadata = None
config = {
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER,
"pms_web_url": plexpy.CONFIG.PMS_WEB_URL
}
if source == 'history':