mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Fix buggy behaviour if user sets friendly name as blank.
Hide "clear logs" button when viewing PMS logs (it has no impact on those). Start major clean up of classes. Initial work to allow SSL communication to Plex servers.
This commit is contained in:
parent
6ecfb9c963
commit
e1e3659eb3
6 changed files with 202 additions and 242 deletions
|
@ -116,17 +116,8 @@ class WebInterface(object):
|
|||
return serve_template(templatename="user.html", title="User", data=user_details)
|
||||
|
||||
@cherrypy.expose
|
||||
def edit_user(self, user=None, friendly_name=None, **kwargs):
|
||||
if user and friendly_name:
|
||||
try:
|
||||
plex_watch = plexwatch.PlexWatch()
|
||||
plex_watch.set_user_friendly_name(user, friendly_name)
|
||||
status_message = "Successfully updated user."
|
||||
return status_message
|
||||
except:
|
||||
status_message = "Failed to updated user."
|
||||
return status_message
|
||||
elif user and not friendly_name:
|
||||
def edit_user_dialog(self, user=None, **kwargs):
|
||||
if user:
|
||||
try:
|
||||
plex_watch = plexwatch.PlexWatch()
|
||||
result = {'user': user,
|
||||
|
@ -143,6 +134,18 @@ class WebInterface(object):
|
|||
else:
|
||||
return serve_template(templatename="edit_user.html", title="Edit User", data=user, status_message='Unknown error.')
|
||||
|
||||
@cherrypy.expose
|
||||
def edit_user(self, user=None, friendly_name=None, **kwargs):
|
||||
if user:
|
||||
try:
|
||||
plex_watch = plexwatch.PlexWatch()
|
||||
plex_watch.set_user_friendly_name(user, friendly_name)
|
||||
status_message = "Successfully updated user."
|
||||
return status_message
|
||||
except:
|
||||
status_message = "Failed to update user."
|
||||
return status_message
|
||||
|
||||
@cherrypy.expose
|
||||
def get_stream_data(self, row_id=None, user=None, **kwargs):
|
||||
|
||||
|
@ -926,3 +929,27 @@ class WebInterface(object):
|
|||
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return json.dumps(output)
|
||||
|
||||
@cherrypy.expose
|
||||
def get_sync_item(self, sync_id, **kwargs):
|
||||
|
||||
pms_connect = pmsconnect.PmsConnect()
|
||||
result = pms_connect.get_sync_item(sync_id, output_format='json')
|
||||
|
||||
if result:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return result
|
||||
else:
|
||||
logger.warn('Unable to retrieve data.')
|
||||
|
||||
@cherrypy.expose
|
||||
def get_sync_transcode_queue(self, **kwargs):
|
||||
|
||||
pms_connect = pmsconnect.PmsConnect()
|
||||
result = pms_connect.get_sync_transcode_queue(output_format='json')
|
||||
|
||||
if result:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
return result
|
||||
else:
|
||||
logger.warn('Unable to retrieve data.')
|
Loading…
Add table
Add a link
Reference in a new issue