private function detectMediaTypes(Context
$context): void
{ $criteria =
$this->
createCriteria();
do { $result =
$this->mediaRepository->
search($criteria,
$context);
/** @var MediaCollection $medias */
$medias =
$result->
getEntities();
foreach ($medias as $media) { $this->
detectMediaType($context,
$media);
} $this->io->
progressAdvance($result->
count());
$criteria->
setOffset($criteria->
getOffset() +
$this->batchSize
);
} while ($result->
getTotal() >
$this->batchSize
);
} private function detectMediaType(Context
$context, MediaEntity
$media): void
{ if (!
$media->
hasFile()) { return;
}