public function listAction(Request $request)
    {
        $mediaTypeManager = $this->get('phlexible_media_type.media_type_manager');
        $iconResolver = $this->get('phlexible_media_type.icon_resolver');

        $mediaTypes = [];
        foreach ($mediaTypeManager->findAll() as $mediaType) {
            $mediaTypes[] = [
                'id' => $mediaType->getName(),
                'key' => $mediaType->getName(),
                'upperkey' => strtoupper($mediaType->getName()),
                'type' => $mediaType->getCategory(),
                'de' => $mediaType->getTitle('de'),
                'en' => $mediaType->getTitle('en'),
                'mimetypes' => $mediaType->getMimetypes(),
                'icon16' => (bool) $iconResolver->resolve($mediaType, 16),
                'icon32' => (bool) $iconResolver->resolve($mediaType, 32),
                'icon48' => (bool) $iconResolver->resolve($mediaType, 48),
                'icon256' => (bool) $iconResolver->resolve($mediaType, 256),
            ];
        }

        return new JsonResponse([
            'totalCount' => count($mediaTypes),
            'mediatypes' => $mediaTypes,
        ]);
    }