Frontend Media Properties

This document is auto-generated from the source code in /frontend/scripts/document-media.js.

This is a list of the media properties, with the descriptions of corresponding TypeScript types that are used in the frontend to hold media objects.

General notes

The columns are sorted alphabetically. Both interfaces ImageDetail and AudioDetail inherit from interface Media so the tables for those interfaces only show their additional fields.

Some types in the “Type” column may refer to interfaces or types defined in the frontend codebase. In such cases it is advised to refer to the source file /frontend/src/types/media.ts and trace the source of the type definitions. Such types are italicised for clarity.

Interface Media

Fields

Name

Type

Optional?

attribution

string

category

string | null

creator

string

creator_url

string

description

string

detail_url

string

fields_matched

string[]

filesize

string

filetype

string

foreign_landing_url

string

frontendMediaType

SupportedMediaType (custom)

id

string

isSensitive

boolean

license

License (custom)

license_url

string

license_version

LicenseVersion (custom)

originalTitle

string

provider

string

providerName

string

related_url

string

sensitivity

Sensitivity[] (custom)

source

string

sourceName

string

tags

Tag[] (custom)

thumbnail

string

title

string

url

string

Notes

attribution

The full text to properly attribute the work to the creator.

category

The descriptive category describing the work.

creator

The text name, handle, or username of the author of the creative work.

creator_url

A URL to the creator’s profile on the provider or other personal webpage, depending on the provider.

description

A long test describing the media, from the provider.

detail_url

The API url of the detail view of a media.

fields_matched

An array of field names that matched the search query.

filesize

A number representing the size of the media in bytes.

filetype

A string representing the filetype of the media. Please note this is not an exact representation of extension or MIME type.

foreign_landing_url

A URL to the page where the media item is hosted on the foreign provider’s site. This is often used to give credit to the original source or for users to find more information.

id

the UUID4 identifier of the media item

See also:

isSensitive

Indicates if the media is marked as sensitive. If true, the media has sensitivity markers that might require user discretion or warnings.

license

The code of the open copy-left license assigned to the work.

license_url

A link to the landing page of the License, typically the deed or another informational page.

license_version

The version number of the Creative Commons license as a string, or an empty string.

originalTitle

The raw name of the creative work, as returned by the API.

provider

A snake_cased slug representing the media’s provider. Corresponds to the source_name field of provider results from the API’s /stats/ endpoints.

providerName

A presentational string (with capitalization, spaces, punctuation, and so on), representing the media’s provider. Corresponds to the display_name field of provider results from the API’s /stats/ endpoints.

sensitivity

An array of sensitivity markers. These markers indicate various sensitivity or content warning categories applicable to the media.

source

A snake_cased slug representing the media’s source. Corresponds to the source_name field of provider results from the API’s /stats/ endpoints.

sourceName

A presentational string (with capitalization, spaces, punctuation, and so on), representing the media’s source. Corresponds to the display_name field of provider results from the API’s /stats/ endpoints.

tags

An array of tags, used to query the media or present on the frontend to find related media.

thumbnail

A URL to a thumbnail image of the media. Typically album art for an audio track, or a minified thumbnail for image works.

title

the name of the creative work; This involves the following kinds of changes to the original title:

  • remove the file extension

  • escape HTML

  • handle empty titles

url

A URL pointing to the actual media file on the provider.

Interface ImageDetail

Fields

Name

Type

Optional?

frontendMediaType

"image" (literal)

height

number

width

number

Notes

height

The vertical length of the image, in pixels.

width

The horizontal length of the image, in pixels.

Interface AudioDetail

Fields

Name

Type

Optional?

alt_files

{ provider: string; filetype: string }[]

audio_set

AudioSet (custom)

bit_rate

number

duration

number

frontendMediaType

"audio" (literal)

genres

string[]

hasLoaded

boolean

peaks

number[]

sample_rate

number

waveform

string

Notes

alt_files

An array of alternative files of different filetypes. This can include different formats of the audio track for compatibility and quality options.

audio_set

An object representing a group of audio tracks this track belongs to, like an album or podcast.

bit_rate

Amount of digital audio data transmitted or processed in unit time. This field holds numbers measured in bits per second (bps).

See also:

duration

The duration of the track in milliseconds.

genres

A raw list of strings representing musical genres.

hasLoaded

Set and managed by the frontend client-side to indicate if the audio has been fully loaded. Useful for managing UI elements based on the loading state of the audio.

peaks

An array of peak amplitude values used to generate a visual representation of the audio waveform.

sample_rate

Number of samples for digital representation taken in unit time. This field holds numbers measured in hertz (Hz).

See also:

waveform

The URL of the API /wavepoint endpoint for the audio track. This endpoint provides the full peaks array for the track.