mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Persist current activity details between refreshes
This commit is contained in:
parent
83b97111a0
commit
4a0f0238b0
4 changed files with 523 additions and 75 deletions
|
@ -231,6 +231,12 @@ class WebInterface(object):
|
|||
logger.warn(u"Unable to retrieve data for get_current_activity.")
|
||||
return serve_template(templatename="current_activity.html", data=None)
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth()
|
||||
def get_current_activity_instance(self, **kwargs):
|
||||
|
||||
return serve_template(templatename="current_activity_instance.html", data=kwargs)
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth()
|
||||
def get_current_activity_header(self, **kwargs):
|
||||
|
@ -3296,7 +3302,7 @@ class WebInterface(object):
|
|||
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
@requireAuth()
|
||||
@addtoapi()
|
||||
def get_activity(self, **kwargs):
|
||||
""" Get the current activity on the PMS.
|
||||
|
@ -3374,9 +3380,15 @@ class WebInterface(object):
|
|||
}
|
||||
```
|
||||
"""
|
||||
pms_connect = pmsconnect.PmsConnect()
|
||||
pms_connect = pmsconnect.PmsConnect(token=plexpy.CONFIG.PMS_TOKEN)
|
||||
result = pms_connect.get_current_activity()
|
||||
|
||||
data_factory = datafactory.DataFactory()
|
||||
for session in result['sessions']:
|
||||
if not session['ip_address']:
|
||||
ip_address = data_factory.get_session_ip(session['session_key'])
|
||||
session['ip_address'] = ip_address
|
||||
|
||||
if result:
|
||||
return result
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue