enhance sync films

This commit is contained in:
thibaud-leclere
2026-01-19 23:22:04 +01:00
parent 5e715a40c6
commit b764116552
5 changed files with 116 additions and 8 deletions

View File

@@ -8,24 +8,21 @@ use App\Exception\GatewayException;
use App\Model\TMDB\TMDBMovie;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Contracts\Cache\CacheInterface;
use Symfony\Contracts\Cache\ItemInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
use function Symfony\Component\String\u;
class TMDBGateway
readonly class TMDBGateway
{
private const string SEARCH_URI = '/search/movie';
private const string MOVIE_CREDITS_URI = '/movie/{id}/credits';
public function __construct(
private readonly HttpClientInterface $client,
private readonly SerializerInterface $serializer,
private HttpClientInterface $client,
private SerializerInterface $serializer,
#[Autowire('%env(TMDB_API_TOKEN)%')]
private readonly string $apiToken,
private string $apiToken,
#[Autowire('%tmdb_host%')]
private readonly string $host,
private string $host,
) {
}