Added Progress command, it's still experimental and only works correctly for plex at the moment. do not use it yet.
This commit is contained in:
@@ -19,6 +19,7 @@ use App\Backends\Plex\Action\GetUserToken;
|
||||
use App\Backends\Plex\Action\Import;
|
||||
use App\Backends\Plex\Action\InspectRequest;
|
||||
use App\Backends\Plex\Action\ParseWebhook;
|
||||
use App\Backends\Plex\Action\Progress;
|
||||
use App\Backends\Plex\Action\Push;
|
||||
use App\Backends\Plex\Action\SearchId;
|
||||
use App\Backends\Plex\Action\SearchQuery;
|
||||
@@ -259,6 +260,26 @@ class PlexClient implements iClient
|
||||
return [];
|
||||
}
|
||||
|
||||
public function progress(array $entities, QueueRequests $queue, iDate|null $after = null): array
|
||||
{
|
||||
$response = Container::get(Progress::class)(
|
||||
context: $this->context,
|
||||
entities: $entities,
|
||||
queue: $queue,
|
||||
after: $after
|
||||
);
|
||||
|
||||
if ($response->hasError()) {
|
||||
$this->logger->log($response->error->level(), $response->error->message, $response->error->context);
|
||||
}
|
||||
|
||||
if (false === $response->isSuccessful()) {
|
||||
throw new RuntimeException(ag($response->extra, 'message', fn() => $response->error->format()));
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function search(string $query, int $limit = 25, array $opts = []): array
|
||||
{
|
||||
$response = Container::get(SearchQuery::class)(
|
||||
|
||||
Reference in New Issue
Block a user