Add Plex XML shortcuts to libraries, users, and sync headers

This commit is contained in:
JonnyWong16 2018-06-02 08:58:55 -07:00
parent 54f4696713
commit 939755d3b7
4 changed files with 17 additions and 3 deletions

View file

@ -277,6 +277,8 @@ class WebInterface(object):
def return_plex_xml_url(self, endpoint='', plextv=False, **kwargs):
kwargs['X-Plex-Token'] = plexpy.CONFIG.PMS_TOKEN
base_url = 'https://plex.tv' if plextv else plexpy.CONFIG.PMS_URL
if '{machine_id}' in endpoint:
endpoint = endpoint.format(machine_id=plexpy.CONFIG.PMS_IDENTIFIER)
return base_url + endpoint + '?' + urllib.urlencode(kwargs)
@cherrypy.expose