mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Add pms_image_proxy to api
This commit is contained in:
parent
ce1d2a0fd9
commit
5968b82a0b
3 changed files with 43 additions and 3 deletions
22
API.md
22
API.md
|
@ -772,7 +772,7 @@ Get the metadata for a media item.
|
||||||
```
|
```
|
||||||
Required parameters:
|
Required parameters:
|
||||||
rating_key (str): Rating key of the item
|
rating_key (str): Rating key of the item
|
||||||
media_info (bool): True or False wheter to get media info
|
media_info (bool): True or False whether to get media info
|
||||||
|
|
||||||
Optional parameters:
|
Optional parameters:
|
||||||
None
|
None
|
||||||
|
@ -1793,6 +1793,26 @@ Returns:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### pms_image_proxy
|
||||||
|
Gets an image from the PMS and saves it to the image cache directory.
|
||||||
|
|
||||||
|
```
|
||||||
|
Required parameters:
|
||||||
|
img (str): /library/metadata/153037/thumb/1462175060
|
||||||
|
or
|
||||||
|
rating_key (str): 54321
|
||||||
|
|
||||||
|
Optional parameters:
|
||||||
|
width (str): 150
|
||||||
|
height (str): 255
|
||||||
|
fallback (str): "poster", "cover", "art"
|
||||||
|
refresh (bool): True or False whether to refresh the image cache
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### refresh_libraries_list
|
### refresh_libraries_list
|
||||||
Refresh the PlexPy libraries list.
|
Refresh the PlexPy libraries list.
|
||||||
|
|
||||||
|
|
|
@ -458,6 +458,10 @@ General optional parameters:
|
||||||
elif self._api_cmd == 'download_log':
|
elif self._api_cmd == 'download_log':
|
||||||
return
|
return
|
||||||
|
|
||||||
|
elif self._api_cmd == 'pms_image_proxy':
|
||||||
|
cherrypy.response.headers['Content-Type'] = 'image/jpeg'
|
||||||
|
return out['response']['data']
|
||||||
|
|
||||||
if self._api_out_type == 'json':
|
if self._api_out_type == 'json':
|
||||||
cherrypy.response.headers['Content-Type'] = 'application/json;charset=UTF-8'
|
cherrypy.response.headers['Content-Type'] = 'application/json;charset=UTF-8'
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -3265,11 +3265,27 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
|
@addtoapi()
|
||||||
def pms_image_proxy(self, img='', rating_key=None, width='0', height='0',
|
def pms_image_proxy(self, img='', rating_key=None, width='0', height='0',
|
||||||
fallback=None, refresh=False, **kwargs):
|
fallback=None, refresh=False, **kwargs):
|
||||||
|
""" Gets an image from the PMS and saves it to the image cache directory.
|
||||||
|
|
||||||
""" Gets an image from the PMS and saves it to the image cache directory. """
|
```
|
||||||
|
Required parameters:
|
||||||
|
img (str): /library/metadata/153037/thumb/1462175060
|
||||||
|
or
|
||||||
|
rating_key (str): 54321
|
||||||
|
|
||||||
|
Optional parameters:
|
||||||
|
width (str): 150
|
||||||
|
height (str): 255
|
||||||
|
fallback (str): "poster", "cover", "art"
|
||||||
|
refresh (bool): True or False whether to refresh the image cache
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
```
|
||||||
|
"""
|
||||||
if not img and not rating_key:
|
if not img and not rating_key:
|
||||||
logger.error('No image input received.')
|
logger.error('No image input received.')
|
||||||
return
|
return
|
||||||
|
@ -3623,7 +3639,7 @@ class WebInterface(object):
|
||||||
```
|
```
|
||||||
Required parameters:
|
Required parameters:
|
||||||
rating_key (str): Rating key of the item
|
rating_key (str): Rating key of the item
|
||||||
media_info (bool): True or False wheter to get media info
|
media_info (bool): True or False whether to get media info
|
||||||
|
|
||||||
Optional parameters:
|
Optional parameters:
|
||||||
None
|
None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue