Class: MediaFile

@bldr/media-server~MediaFile

Base class to be extended.

new MediaFile ()

Members

absPath_ string private

Absolute path ot the file.

basename_ string private

The basename (filename without extension) of the file.

extension string

The extension of the file.

filename string

The basename (filename) of the file.

path string

Relative path ot the file.

size number

The file size in bytes.

timeModified float

The timestamp indicating the last time this file was modified expressed in milliseconds since the POSIX Epoch.

Methods

addFileInfos ()

Add metadata from the file system, like file size or timeModifed.

addFileInfos_ () private

cleanTmpProperties ()

Delete the temporary properties of the object. Temporary properties end with _.

importProperties (properties)

Merge an object into the class object. Properties can be in the snake_case or kebab-case form. They are converted into camelCase in a recursive fashion.

Name Type Description
properties object

Add an object to the class properties.

prepareForInsert ()

Prepare the object for the insert into the MongoDB database Generate id and title if this properties are not present.

readYaml_ (filePath)object private

Parse the info file of a media asset or the presenation file itself.

Each media file can have a info file that stores additional metadata informations.

File path: /home/baldr/beethoven.jpg

Info file in the YAML file format: /home/baldr/beethoven.jpg.yml

Name Type Description
filePath string

The path of the YAML file.

Returns:
Type Description
object