mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Catch exception when retrieving current activity
This commit is contained in:
parent
77bd52b2ae
commit
29522428de
1 changed files with 14 additions and 11 deletions
|
@ -3738,19 +3738,22 @@ class WebInterface(object):
|
|||
}
|
||||
```
|
||||
"""
|
||||
pms_connect = pmsconnect.PmsConnect(token=plexpy.CONFIG.PMS_TOKEN)
|
||||
result = pms_connect.get_current_activity()
|
||||
try:
|
||||
pms_connect = pmsconnect.PmsConnect(token=plexpy.CONFIG.PMS_TOKEN)
|
||||
result = pms_connect.get_current_activity()
|
||||
|
||||
if result:
|
||||
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:
|
||||
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
|
||||
|
||||
return result
|
||||
else:
|
||||
logger.warn(u"Unable to retrieve data for get_activity.")
|
||||
return result
|
||||
else:
|
||||
logger.warn(u"Unable to retrieve data for get_activity.")
|
||||
except Exception as e:
|
||||
logger.exception(u"Unable to retrieve data for get_activity: %s" % e)
|
||||
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue