z_media_import (zotonic_core v1.0.0-rc.10)

Import media from internet locations.

Link to this section Summary

Functions

Create a resource with a selected #media_import_props{}, URL or embed code.
Create a resource with a selected #media_import_props{}, URL or embed code. Add the forced properties to the resource.
Update a resource's medium record with the selected #media_import_props(), URL or embed code.
Find possible rsc/medium mappings for the url or fetched url metadata

Link to this section Functions

Link to this function

insert(MediaImport, Context)

-spec insert(MediaImport, Context) -> {ok, m_rsc:resource_id()} | {error, term()}
          when
              MediaImport :: #media_import_props{} | Url,
              Url :: string() | binary(),
              Context :: z:context().
Create a resource with a selected #media_import_props{}, URL or embed code.
Link to this function

insert(MediaImport, RscProps, Context)

-spec insert(MediaImport, RscProps, Context) -> {ok, m_rsc:resource_id()} | {error, term()}
          when
              MediaImport :: #media_import_props{} | Url,
              Url :: string() | binary(),
              RscProps :: #{binary() => term()},
              Context :: z:context().
Create a resource with a selected #media_import_props{}, URL or embed code. Add the forced properties to the resource.
Link to this function

update(RscId, MediaImport, Context)

-spec update(RscId, MediaImport, Context) -> {ok, m_rsc:resource_id()} | {error, term()}
          when
              RscId :: m_rsc:resource_id(),
              MediaImport :: #media_import_props{} | Url,
              Url :: string() | binary(),
              Context :: z:context().
Update a resource's medium record with the selected #media_import_props(), URL or embed code.
Link to this function

url_import_props(Url, Context)

-spec url_import_props(z_url_metadata:metadata() | string() | binary(), z:context()) ->
                    {ok, [#media_import_props{}]} | {error, term()}.
Find possible rsc/medium mappings for the url or fetched url metadata