FoPost.MediaAsset (FoPost v0.1.0)

Copy Markdown View Source

One asset in a workspace's media library.

FoPost.Media.upload/2 answers with the same struct, shaped so it drops straight into a post's content block through to_media_item/1.

Summary

Functions

Turns an uploaded asset into the media map a post's content block expects.

Types

t()

@type t() :: %FoPost.MediaAsset{
  alt_text: term(),
  created_at: term(),
  id: term(),
  mime_type: term(),
  name: term(),
  raw: term(),
  size: term(),
  type: term(),
  url: term(),
  user_id: term(),
  workspace_id: term()
}

Functions

to_media_item(asset)

@spec to_media_item(t()) :: FoPost.MediaItem.t()

Turns an uploaded asset into the media map a post's content block expects.