metadata: move metadata parsing into ExifTool::Metadata.

Move the metadata parsing code from MediaAsset to ExifTool::Metadata so
we can use it outside the context of a MediaAsset, in particular when
dealing with a MediaFile that hasn't been saved to disk yet.
This commit is contained in:
evazion
2021-09-26 02:58:08 -05:00
parent 960817e9fe
commit ab3f35580f
3 changed files with 100 additions and 59 deletions

View File

@@ -23,4 +23,8 @@ class MediaMetadata < ApplicationRecord
def file=(file_or_path)
self.metadata = MediaFile.open(file_or_path).metadata
end
def metadata
ExifTool::Metadata.new(self[:metadata])
end
end