# Media:generate-media-types?

**URL:** <https://forum.shopware.com/t/media-generate-media-types/100609>\
**Category:** Administration\
**Created:** [24. Juli 2023 um 11:24 UTC](https://forum.shopware.com/t/media-generate-media-types/100609 "2023-07-24T11:24:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbm](https://avatars.discourse-cdn.com/v4/letter/c/a9a28c/32.png) [@cbm](https://forum.shopware.com/u/cbm)\
**Post date:** [24. Juli 2023 um 11:24 UTC](https://forum.shopware.com/t/media-generate-media-types/100609/1 "2023-07-24T11:24:44Z")

</div>

Was macht dieser CLI-Befehl genau:  
media:generate-media-types

Ich finde in allen Beschreibungen leider nur ein: „Generates the media types for all media entities“.  
Hat jemand genauere Infos für mich?

---

<div class="post-metadata">

**Author:** ![jissereitsma](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/jissereitsma/32/22288_2.png) [@jissereitsma](https://forum.shopware.com/u/jissereitsma)\
**Post date:** [22. November 2023 um 10:13 UTC](https://forum.shopware.com/t/media-generate-media-types/100609/2 "2023-11-22T10:13:27Z")

</div>

I bumped into this myself as well. The `media:generate-media-types` scans for all existing media entities (so, all records available in the database table `media` which equals all of the media found in the Administration under **Content \> Media**. Next, for each media entity, the `type` is determined - which is either an image, a video, an audio file or a document (like a PDF). This type is then saved to the database table `media` under the column `media_type`.

That’s how it technically works. However, it still probably doesn’t tell when this command needs to be run. I guess, in a normal situation, you don’t need it. However, it might come in handy when importing media from an external location?
