Add location, relayed, and secure to get_history response

This commit is contained in:
JonnyWong16 2022-01-25 14:03:39 -08:00
parent 484c7ed4a2
commit 12dddc2d89
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 16 additions and 1 deletions

View file

@ -101,6 +101,9 @@ class DataFactory(object):
'player',
'ip_address',
'machine_id',
'location',
'secure',
'relayed',
'session_history.media_type',
'(CASE WHEN session_history_metadata.live = 1 THEN "live" ELSE session_history.media_type END) \
AS media_type_live',
@ -156,6 +159,9 @@ class DataFactory(object):
'player',
'ip_address',
'machine_id',
'location',
'secure',
'relayed',
'media_type',
'(CASE WHEN live = 1 THEN "live" ELSE media_type END) AS media_type_live',
'rating_key',
@ -271,6 +277,9 @@ class DataFactory(object):
'ip_address': item['ip_address'],
'live': item['live'],
'machine_id': item['machine_id'],
'location': item['location'],
'secure': item['secure'],
'relayed': item['relayed'],
'media_type': item['media_type'],
'rating_key': item['rating_key'],
'parent_rating_key': item['parent_rating_key'],

View file

@ -1920,6 +1920,7 @@ class WebInterface(object):
"guid": "com.plexapp.agents.thetvdb://121361/6/1?lang=en",
"ip_address": "xxx.xxx.xxx.xxx",
"live": 0,
"location": "wan",
"machine_id": "lmd93nkn12k29j2lnm",
"media_index": 17,
"media_type": "episode",
@ -1934,7 +1935,9 @@ class WebInterface(object):
"player": "Castle-PC",
"rating_key": 4348,
"reference_id": 1123,
"relayed": 0,
"row_id": 1124,
"secure": 1,
"session_key": null,
"started": 1462688107,
"state": null,
@ -2130,7 +2133,10 @@ class WebInterface(object):
if not helpers.is_valid_ip(ip_address):
ip_address = None
return serve_template(templatename="ip_address_modal.html", title="IP Address Details", data=ip_address)
public = helpers.is_public_ip(ip_address)
return serve_template(templatename="ip_address_modal.html", title="IP Address Details",
data=ip_address, public=public, kwargs=kwargs)
@cherrypy.expose
@cherrypy.tools.json_out()