refactor: track import progress per film instead of per batch

Replace batch-level progress (processedBatches/totalBatches) with
film-level progress (processedFilms/totalFilms) for smoother UI updates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-04-01 19:30:15 +02:00
parent 8c73a22eff
commit 369893a77e
7 changed files with 70 additions and 62 deletions

View File

@@ -18,10 +18,10 @@ class ImportRepository extends ServiceEntityRepository
parent::__construct($registry, Import::class);
}
public function incrementProcessedBatches(Import $import): int
public function incrementProcessedFilms(Import $import): int
{
return (int) $this->getEntityManager()->getConnection()->fetchOne(
'UPDATE import SET processed_batches = processed_batches + 1 WHERE id = :id RETURNING processed_batches',
'UPDATE import SET processed_films = processed_films + 1 WHERE id = :id RETURNING processed_films',
['id' => $import->getId()]
);
}