mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-06 04:20:52 +00:00
97 lines
7.5 KiB
Markdown
97 lines
7.5 KiB
Markdown
# Hubs
|
|
(*hubs*)
|
|
|
|
## Overview
|
|
|
|
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
|
|
|
|
|
|
### Available Operations
|
|
|
|
* [get_global_hubs](#get_global_hubs) - Get Global Hubs
|
|
* [get_library_hubs](#get_library_hubs) - Get library specific hubs
|
|
|
|
## get_global_hubs
|
|
|
|
Get Global Hubs filtered by the parameters provided.
|
|
|
|
### Example Usage
|
|
|
|
```python
|
|
import plex_api
|
|
from plex_api.models import operations
|
|
|
|
s = plex_api.PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
|
|
res = s.hubs.get_global_hubs(count=1262.49, only_transient=operations.OnlyTransient.ONE)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| `count` | *Optional[float]* | :heavy_minus_sign: | The number of items to return with each hub. |
|
|
| `only_transient` | [Optional[operations.OnlyTransient]](../../models/operations/onlytransient.md) | :heavy_minus_sign: | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
|
|
|
|
|
|
### Response
|
|
|
|
**[operations.GetGlobalHubsResponse](../../models/operations/getglobalhubsresponse.md)**
|
|
### Errors
|
|
|
|
| Error Object | Status Code | Content Type |
|
|
| -------------------------------- | -------------------------------- | -------------------------------- |
|
|
| errors.GetGlobalHubsResponseBody | 401 | application/json |
|
|
| errors.SDKError | 4x-5xx | */* |
|
|
|
|
## get_library_hubs
|
|
|
|
This endpoint will return a list of library specific hubs
|
|
|
|
|
|
### Example Usage
|
|
|
|
```python
|
|
import plex_api
|
|
from plex_api.models import operations
|
|
|
|
s = plex_api.PlexAPI(
|
|
access_token="<YOUR_API_KEY_HERE>",
|
|
)
|
|
|
|
|
|
res = s.hubs.get_library_hubs(section_id=6728.76, count=9010.22, only_transient=operations.QueryParamOnlyTransient.ZERO)
|
|
|
|
if res.object is not None:
|
|
# handle response
|
|
pass
|
|
|
|
```
|
|
|
|
### Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| `section_id` | *float* | :heavy_check_mark: | the Id of the library to query |
|
|
| `count` | *Optional[float]* | :heavy_minus_sign: | The number of items to return with each hub. |
|
|
| `only_transient` | [Optional[operations.QueryParamOnlyTransient]](../../models/operations/queryparamonlytransient.md) | :heavy_minus_sign: | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
|
|
|
|
|
|
### Response
|
|
|
|
**[operations.GetLibraryHubsResponse](../../models/operations/getlibraryhubsresponse.md)**
|
|
### Errors
|
|
|
|
| Error Object | Status Code | Content Type |
|
|
| --------------------------------- | --------------------------------- | --------------------------------- |
|
|
| errors.GetLibraryHubsResponseBody | 401 | application/json |
|
|
| errors.SDKError | 4x-5xx | */* |
|