mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Some work on sync lists.
This commit is contained in:
parent
4830cc7d68
commit
69ffaf5292
7 changed files with 333 additions and 26 deletions
|
@ -97,6 +97,10 @@ class WebInterface(object):
|
|||
def graphs(self):
|
||||
return serve_template(templatename="graphs.html", title="Graphs")
|
||||
|
||||
@cherrypy.expose
|
||||
def sync(self):
|
||||
return serve_template(templatename="sync.html", title="Synced Items")
|
||||
|
||||
@cherrypy.expose
|
||||
def user(self, user=None):
|
||||
try:
|
||||
|
@ -891,3 +895,22 @@ class WebInterface(object):
|
|||
|
||||
logger.info("Users list refreshed.")
|
||||
raise cherrypy.HTTPRedirect("users")
|
||||
|
||||
@cherrypy.expose
|
||||
def get_sync(self, machine_id='', **kwargs):
|
||||
|
||||
pms_connect = pmsconnect.PmsConnect()
|
||||
server_info = pms_connect.get_servers_info()
|
||||
|
||||
plex_tv = plextv.PlexTV()
|
||||
if not machine_id:
|
||||
result = plex_tv.get_synced_items(machine_id=server_info[0]['machine_identifier'])
|
||||
else:
|
||||
result = plex_tv.get_synced_items(machine_id=machine_id)
|
||||
|
||||
if result:
|
||||
cherrypy.response.headers['Content-type'] = 'application/json'
|
||||
output = {"data": result}
|
||||
return json.dumps(output)
|
||||
else:
|
||||
logger.warn('Unable to retrieve data.')
|
Loading…
Add table
Add a link
Reference in a new issue