mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 08:16:06 -07:00
Allow manual PMS URL override in config file for XML shortcuts
This commit is contained in:
parent
50c5407a46
commit
668913fd60
2 changed files with 11 additions and 1 deletions
|
@ -54,6 +54,7 @@ _CONFIG_DEFINITIONS = {
|
||||||
'PMS_TOKEN': (str, 'PMS', ''),
|
'PMS_TOKEN': (str, 'PMS', ''),
|
||||||
'PMS_SSL': (int, 'PMS', 0),
|
'PMS_SSL': (int, 'PMS', 0),
|
||||||
'PMS_URL': (str, 'PMS', ''),
|
'PMS_URL': (str, 'PMS', ''),
|
||||||
|
'PMS_URL_OVERRIDE': (str, 'PMS', ''),
|
||||||
'PMS_URL_MANUAL': (int, 'PMS', 0),
|
'PMS_URL_MANUAL': (int, 'PMS', 0),
|
||||||
'PMS_USE_BIF': (int, 'PMS', 0),
|
'PMS_USE_BIF': (int, 'PMS', 0),
|
||||||
'PMS_UUID': (str, 'PMS', ''),
|
'PMS_UUID': (str, 'PMS', ''),
|
||||||
|
|
|
@ -276,9 +276,18 @@ class WebInterface(object):
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def return_plex_xml_url(self, endpoint='', plextv=False, **kwargs):
|
def return_plex_xml_url(self, endpoint='', plextv=False, **kwargs):
|
||||||
kwargs['X-Plex-Token'] = plexpy.CONFIG.PMS_TOKEN
|
kwargs['X-Plex-Token'] = plexpy.CONFIG.PMS_TOKEN
|
||||||
base_url = 'https://plex.tv' if plextv else plexpy.CONFIG.PMS_URL
|
|
||||||
|
if plextv:
|
||||||
|
base_url = 'https://plex.tv'
|
||||||
|
else:
|
||||||
|
if plexpy.CONFIG.PMS_URL_OVERRIDE:
|
||||||
|
base_url = plexpy.CONFIG.PMS_URL_OVERRIDE
|
||||||
|
else:
|
||||||
|
base_url = plexpy.CONFIG.PMS_URL
|
||||||
|
|
||||||
if '{machine_id}' in endpoint:
|
if '{machine_id}' in endpoint:
|
||||||
endpoint = endpoint.format(machine_id=plexpy.CONFIG.PMS_IDENTIFIER)
|
endpoint = endpoint.format(machine_id=plexpy.CONFIG.PMS_IDENTIFIER)
|
||||||
|
|
||||||
return base_url + endpoint + '?' + urllib.urlencode(kwargs)
|
return base_url + endpoint + '?' + urllib.urlencode(kwargs)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue