Implemented Get sessions for plex.

This commit is contained in:
abdulmohsen
2024-01-17 17:04:52 +03:00
parent abda2b0273
commit 69a4008c19
4 changed files with 336 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ use App\Backends\Plex\Action\GetInfo;
use App\Backends\Plex\Action\GetLibrariesList;
use App\Backends\Plex\Action\GetLibrary;
use App\Backends\Plex\Action\GetMetaData;
use App\Backends\Plex\Action\GetSessions;
use App\Backends\Plex\Action\GetUsersList;
use App\Backends\Plex\Action\GetUserToken;
use App\Backends\Plex\Action\GetVersion;
@@ -459,6 +460,24 @@ class PlexClient implements iClient
return $response->response;
}
/**
* @inheritdoc
*/
public function getSessions(array $opts = []): array
{
$response = Container::get(GetSessions::class)($this->context, $opts);
if (false === $response->isSuccessful()) {
if ($response->hasError()) {
$this->logger->log($response->error->level(), $response->error->message, $response->error->context);
}
$this->throwError($response);
}
return $response->response;
}
/**
* @inheritdoc
*/