mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 08:16:06 -07:00
Improve terminate stream error messages
This commit is contained in:
parent
00405f0b18
commit
76b9b3e474
3 changed files with 33 additions and 11 deletions
|
@ -246,7 +246,7 @@ class WebInterface(object):
|
|||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def terminate_session(self, session_key=None, session_id=None, message=None, **kwargs):
|
||||
def terminate_session(self, session_key='', session_id='', message='', **kwargs):
|
||||
""" Stop a streaming session.
|
||||
|
||||
```
|
||||
|
@ -264,8 +264,10 @@ class WebInterface(object):
|
|||
pms_connect = pmsconnect.PmsConnect()
|
||||
result = pms_connect.terminate_session(session_key=session_key, session_id=session_id, message=message)
|
||||
|
||||
if result:
|
||||
if result is True:
|
||||
return {'result': 'success', 'message': 'Session terminated.'}
|
||||
elif result:
|
||||
return {'result': 'error', 'message': 'Failed to terminate session: {}.'.format(result)}
|
||||
else:
|
||||
return {'result': 'error', 'message': 'Failed to terminate session.'}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue