Posted by zhangweiwu on September 14, 2019 at 1:56pm
Just looking for advice on how to manage media that is already in a directory-based structure. It seems the Video module for Drupal 8 was designed with the idea that the media files are first uploaded in the browser individually, while I already have 12,000 video clips on-disk in a directory structure.
I guess the path is:
- Create a Video content-type with only one field (video), plus term-reference (from Taxonomy);
- For every file in the directory, create a node of Video content-type, which links to the video on disk.
- For every video generated, tag it with the path of the video. e.g. outdoor/Japan/3.mp4 becomes tagged with "outdoor" and "Japan".
At first, this looks like a lot of work. Is there another way or tool to get the job done? Thanks.
Comments
I should imagine a
I should imagine a reasonably-capable developer could write you an import script which scans the directory and registers each video found as a Media module entity.
It wouldn't take much effort from there to make this a cron job so you can periodically scan the directory for new files.
(I've written this not knowing if such an option already exists, though - there may already be a directory importer for the Media module. I'm also assuming the Media module actually does handle videos...?)
Thank you. I'd like to be
Thank you. I'd like to be educated on why each video should be imported as a Media Module Entity instead of a Content-Type that has only one Video Field? Coming from Drupal 7 creating a new entity type isn't what I'm used to doing.