Add MediaMetadata model.

Add a model for storing image and video metadata for uploaded files.

Metadata is extracted using ExifTool. You will need to install ExifTool
after this commit. ExifTool 12.22 is the minimum required version
because we use the `--binary` option, which was added in this release.

The MediaMetadata model is separate from the MediaAsset model because
some files contain tons of metadata, and most of it is non-essential.
The MediaAsset model represents an uploaded file and contains essential
metadata, like the file's size and type, while the MediaMetadata model
represents all the other non-essential metadata associated with a file.

Metadata is stored as a JSON column in the database.

ExifTool returns all the file's metadata, not just the EXIF metadata.
EXIF is one of several types of image metadata, hence why we call
it MediaMetadata instead of EXIFMetadata.
This commit is contained in:
evazion
2021-09-07 18:22:34 -05:00
parent 291758ddb7
commit 3d660953d4
20 changed files with 235 additions and 21 deletions

View File

@@ -0,0 +1,8 @@
class MediaMetadataController < ApplicationController
respond_to :json, :xml
def index
@media_metadata = authorize MediaMetadata.visible(CurrentUser.user).paginated_search(params, count_pages: true)
respond_with(@media_metadata)
end
end