Add QR code to link PlexPy Remote android app

This commit is contained in:
JonnyWong16 2016-11-17 23:14:23 -08:00
parent ebf014406d
commit 9e64463e70
3 changed files with 126 additions and 10 deletions

View file

@ -4607,3 +4607,30 @@ class WebInterface(object):
"""
whois_info = helpers.whois_lookup(ip_address)
return whois_info
@cherrypy.expose
@cherrypy.tools.json_out()
@requireAuth()
def get_plexpy_url(self, **kwargs):
if plexpy.CONFIG.ENABLE_HTTPS:
scheme = 'https'
else:
scheme = 'http'
if plexpy.CONFIG.HTTP_HOST == '0.0.0.0':
import socket
hostname = socket.gethostbyname(socket.gethostname())
else:
hostname = plexpy.CONFIG.HTTP_HOST
if plexpy.CONFIG.HTTP_PORT not in (80, 443):
port = ':' + str(plexpy.CONFIG.HTTP_PORT)
else:
port = ''
if plexpy.CONFIG.HTTP_ROOT:
root = '/' + plexpy.CONFIG.HTTP_ROOT.strip('/')
else:
root = ''
return scheme + '://' + hostname + port + root