Some work on sync lists.
This commit is contained in:
@@ -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.')
|
Reference in New Issue
Block a user