mirror of
https://github.com/LukeHagar/plexphp.git
synced 2025-12-06 04:20:51 +00:00
Hubs
Overview
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
Available Operations
- getGlobalHubs - Get Global Hubs
- getLibraryHubs - Get library specific hubs
getGlobalHubs
Get Global Hubs filtered by the parameters provided.
Example Usage
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \LukeHagar\Plex_API;
use \LukeHagar\Plex_API\Models\Components;
use \LukeHagar\Plex_API\Models\Operations;
$security = new Components\Security();
$security->accessToken = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()
->setXPlexClientIdentifier('Postman')
->setSecurity($security)->build();
try {
$response = $sdk->hubs->getGlobalHubs(1262.49, Operations\OnlyTransient::One);
if ($response->twoHundredApplicationJsonObject !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
count |
float | ➖ | The number of items to return with each hub. |
onlyTransient |
\LukeHagar\Plex_API\Models\Operations\OnlyTransient | ➖ | 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
?\LukeHagar\Plex_API\Models\Operations\GetGlobalHubsResponse
getLibraryHubs
This endpoint will return a list of library specific hubs
Example Usage
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \LukeHagar\Plex_API;
use \LukeHagar\Plex_API\Models\Components;
use \LukeHagar\Plex_API\Models\Operations;
$security = new Components\Security();
$security->accessToken = '<YOUR_API_KEY_HERE>';
$sdk = Plex_API\PlexAPI::builder()
->setXPlexClientIdentifier('Postman')
->setSecurity($security)->build();
try {
$response = $sdk->hubs->getLibraryHubs(6728.76, 9010.22, Operations\QueryParamOnlyTransient::Zero);
if ($response->twoHundredApplicationJsonObject !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sectionId |
float | ✔️ | the Id of the library to query |
count |
float | ➖ | The number of items to return with each hub. |
onlyTransient |
\LukeHagar\Plex_API\Models\Operations\QueryParamOnlyTransient | ➖ | 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
?\LukeHagar\Plex_API\Models\Operations\GetLibraryHubsResponse