Currently we have a MediaAsset with title, description etc plus a mediaType field (enum of image, audio, video ...) and metadata (duration, codec etc). The MediaAsset has one or more links to Files, which have a link to the file content plus file-level metadata (size, filename, MIME type). Having multiple files on one media asset is intended for multiple encodings of the same content.
We are discussing if the following is better:
File entity has a reference to the content plus file level metadata. File (in a GraphQL representation) also has details as enum of Image and AudioVideoContainer and Other for now. If Image a record with the same ID as the file exists that has image metadata, the same for AudioVideoContainer. The latter has duration, some metadata and a list of Tracks which are either audio or video and have the codec info and metadata (e.g. language) for individual tracks.
The MediaAsset links to one or more Files. Its mediaType is just informational. It may duplicate some information from the file details (e.g. duration, or image size) - this is still tbd.
A File does not necessarily have a link from a MediaAsset. E.g. thumbnails could be Files with Image details but no media asset.
Also, the MediaAsset should have a notion of primaryFile and alternativeEncodings or so, not a flat list of files.
Currently we have a
MediaAssetwith title, description etc plus amediaTypefield (enum ofimage,audio,video...) and metadata (duration, codec etc). TheMediaAssethas one or more links toFiles, which have a link to the file content plus file-level metadata (size, filename, MIME type). Having multiple files on one media asset is intended for multiple encodings of the same content.We are discussing if the following is better:
Fileentity has a reference to the content plus file level metadata.File(in a GraphQL representation) also hasdetailsas enum ofImageandAudioVideoContainerandOtherfor now. IfImagea record with the same ID as the file exists that has image metadata, the same forAudioVideoContainer. The latter has duration, some metadata and a list ofTracks which are either audio or video and have the codec info and metadata (e.g. language) for individual tracks.The
MediaAssetlinks to one or moreFiles. ItsmediaTypeis just informational. It may duplicate some information from the file details (e.g. duration, or image size) - this is still tbd.A
Filedoes not necessarily have a link from aMediaAsset. E.g. thumbnails could beFiles withImagedetails but no media asset.Also, the
MediaAssetshould have a notion ofprimaryFileandalternativeEncodingsor so, not a flat list offiles.