mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Fix issue with server verification when working remotely.
This commit is contained in:
parent
637339ea62
commit
30c20b3061
4 changed files with 36 additions and 9 deletions
|
@ -1000,3 +1000,26 @@ class WebInterface(object):
|
|||
@cherrypy.expose
|
||||
def plexwatch_import(self, **kwargs):
|
||||
return serve_template(templatename="plexwatch_import.html", title="Import PlexWatch Database")
|
||||
|
||||
@cherrypy.expose
|
||||
def get_server_id(self, hostname=None, port=None, **kwargs):
|
||||
from plexpy import http_handler
|
||||
|
||||
if hostname and port:
|
||||
request_handler = http_handler.HTTPHandler(host=hostname,
|
||||
port=port,
|
||||
token=None)
|
||||
uri = '/identity'
|
||||
request = request_handler.make_request(uri=uri,
|
||||
proto='http',
|
||||
request_type='GET',
|
||||
output_format='',
|
||||
no_token=True)
|
||||
if request:
|
||||
cherrypy.response.headers['Content-type'] = 'application/xml'
|
||||
return request
|
||||
else:
|
||||
logger.warn('Unable to retrieve data.')
|
||||
return None
|
||||
else:
|
||||
return None
|
Loading…
Add table
Add a link
Reference in a new issue