feat: torrentio api for movie results
This commit is contained in:
23
src/Torrentio/Action/Handler/GetMovieOptionsHandler.php
Normal file
23
src/Torrentio/Action/Handler/GetMovieOptionsHandler.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Torrentio\Action\Handler;
|
||||
|
||||
use App\Torrentio\Action\Result\GetMovieOptionsResult;
|
||||
use App\Torrentio\Client\Torrentio;
|
||||
use OneToMany\RichBundle\Contract\CommandInterface;
|
||||
use OneToMany\RichBundle\Contract\HandlerInterface;
|
||||
use OneToMany\RichBundle\Contract\ResultInterface;
|
||||
|
||||
class GetMovieOptionsHandler implements HandlerInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly Torrentio $torrentio,
|
||||
) {}
|
||||
|
||||
public function handle(CommandInterface $command): ResultInterface
|
||||
{
|
||||
return new GetMovieOptionsResult(
|
||||
results: $this->torrentio->search($command->imdbId, 'movies')
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user