Add get_pms_update to the API

This commit is contained in:
JonnyWong16 2016-10-09 10:19:50 -07:00 committed by JonnyWong16
parent 8595fb97ce
commit 61507c03a0
2 changed files with 58 additions and 3 deletions

28
API.md
View file

@ -1176,6 +1176,34 @@ Returns:
``` ```
### get_pms_update
Check for updates to the Plex Media Server.
```
Required parameters:
None
Optional parameters:
None
Returns:
json:
{"update_available": true,
"platform": "Windows",
"release_date": "1473721409",
"version": "1.1.4.2757-24ffd60",
"requirements": "...",
"extra_info": "...",
"changelog_added": "...",
"changelog_fixed": "...",
"label": "Download",
"distro": "english",
"distro_build": "windows-i386",
"download_url": "https://downloads.plex.tv/...",
}
```
### get_recently_added ### get_recently_added
Get all items that where recelty added to plex. Get all items that where recelty added to plex.

View file

@ -4445,9 +4445,36 @@ class WebInterface(object):
@cherrypy.expose @cherrypy.expose
@cherrypy.tools.json_out() @cherrypy.tools.json_out()
@requireAuth(member_of("admin")) @requireAuth(member_of("admin"))
def check_pms_updater(self, **kwargs): @addtoapi()
pms_connect = pmsconnect.PmsConnect() def get_pms_update(self, **kwargs):
result = pms_connect.get_update_staus() """ Check for updates to the Plex Media Server.
```
Required parameters:
None
Optional parameters:
None
Returns:
json:
{"update_available": true,
"platform": "Windows",
"release_date": "1473721409",
"version": "1.1.4.2757-24ffd60",
"requirements": "...",
"extra_info": "...",
"changelog_added": "...",
"changelog_fixed": "...",
"label": "Download",
"distro": "english",
"distro_build": "windows-i386",
"download_url": "https://downloads.plex.tv/...",
}
```
"""
plex_tv = plextv.PlexTV()
result = plex_tv.get_plex_downloads()
return result return result
@cherrypy.expose @cherrypy.expose