remove unused sync commands (app:sync-actors, app:sync-films)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-03-31 21:55:08 +02:00
parent ded3d063c6
commit c5d359bb0c
2 changed files with 0 additions and 94 deletions

View File

@@ -1,37 +0,0 @@
<?php
namespace App\Command;
use App\Entity\Movie;
use App\Exception\GatewayException;
use App\Service\ActorSyncer;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Output\OutputInterface;
#[AsCommand('app:sync-actors')]
readonly class SyncActorsCommand
{
public function __construct(
private ActorSyncer $actorSyncer,
private EntityManagerInterface $em,
) {}
public function __invoke(OutputInterface $output): int
{
foreach ($this->em->getRepository(Movie::class)->findAll() as $film) {
try {
$output->writeln('Syncing cast for '.$film->getTitle());
$this->actorSyncer->syncActorsForMovie($film);
} catch (GatewayException $e) {
$output->writeln('/!\ '.$e->getMessage());
continue;
}
$this->em->flush();
}
return Command::SUCCESS;
}
}

View File

@@ -1,57 +0,0 @@
<?php
namespace App\Command;
use App\Exception\GatewayException;
use App\Gateway\LtbxdGateway;
use App\Service\FilmImporter;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Output\OutputInterface;
#[AsCommand('app:sync-films')]
readonly class SyncFilmsCommands
{
public function __construct(
private LtbxdGateway $ltbxdGateway,
private FilmImporter $filmImporter,
private EntityManagerInterface $em,
) {}
public function __invoke(OutputInterface $output): int
{
try {
$ltbxdMovies = $this->ltbxdGateway->parseFile();
} catch (GatewayException $e) {
$output->writeln('/!\ '.$e->getMessage());
return Command::FAILURE;
}
$i = 0;
foreach ($ltbxdMovies as $ltbxdMovie) {
try {
$movie = $this->filmImporter->importFromLtbxdMovie($ltbxdMovie);
if ($movie) {
$output->writeln('* Found '.$ltbxdMovie->getName());
}
} catch (GatewayException $e) {
$output->writeln('/!\ '.$e->getMessage());
return Command::FAILURE;
}
++$i;
if (0 === $i % 50) {
$this->em->flush();
}
}
$this->em->flush();
$output->writeln('Films synced');
return Command::SUCCESS;
}
}