···11+import type { Track } from "~/definitions/types.d.ts";
22+import type { DiffuseElement } from "~/common/element.js";
33+import type { ProxiedActions } from "~/common/worker.d.ts";
44+55+export type Actions = {
66+ get(track: Track): Promise<Uint8Array | null>;
77+};
88+99+export type ArtworkElement = DiffuseElement & ProxiedActions<Actions>;
···14141515# ELEMENTS
16161717+artwork:
1818+ - url: "components/artwork/audio-metadata/element.js"
1919+ title: "Audio Metadata"
2020+ desc: "Extracts embedded artwork from audio files using the music-metadata library."
2121+ - url: "components/artwork/last.fm/element.js"
2222+ title: "Last.fm"
2323+ desc: "Fetches cover art from the Last.fm API using track artist and album tags."
2424+ - url: "components/artwork/musicbrainz/element.js"
2525+ title: "MusicBrainz"
2626+ desc: "Fetches cover art from MusicBrainz and the Cover Art Archive using track artist and album tags."
2727+1728configurators:
2929+ - url: "components/configurator/artwork/element.js"
3030+ title: "Artwork"
3131+ desc: "Takes artwork components as children and tries each in sequence, returning the first non-null result."
1832 - url: "components/configurator/input/element.js"
1933 title: "Input"
2034 desc: "Allows for multiple inputs to be used at once."
···106120 - url: "components/orchestrator/sources/element.js"
107121 title: "Sources"
108122 desc: "Monitor tracks from the given output to form a list of sources based on the input's sources return value."
123123+ - url: "components/orchestrator/artwork/element.js"
124124+ title: "Artwork"
125125+ desc: "Fetches cover art for a given set of tracks, stored locally in indexedDB. Uses the artwork configurator to try each configured source in sequence."
109126 - url: "components/orchestrator/scoped-tracks/element.js"
110127 title: "Scoped Tracks"
111128 desc: "Supplies the tracks from the given output to the given search processor whenever the tracks collection changes. Additionally it can perform a search and other ways to reduce the scope of tracks based on the given scope engine. Provides a `tracks` signal similar to `output.tracks.collection`"
···124141 Store your user data on the storage associated with your ATProtocol identity. Data is lexicon shaped by default so this element takes in that data directly without any transformations.
125142126143processors:
127127- - url: "components/processor/artwork/element.js"
128128- title: "Artwork"
129129- desc: "Fetches cover art for a given set of tracks, stored locally in indexedDB. Checks the audio metadata first, then MusicBrainz and uses Last.fm as the fallback."
130144 - url: "components/processor/metadata/element.js"
131145 title: "Metadata"
132146 desc: "Fetch audio metadata for a given set of tracks, adding to the `Track` object."
···219233 Diffuse was built using these web components, consume these using the <a href="../build/">build tool</a>, the Javascript <a href="https://jsr.io/@toko/diffuse">package</a>, or the linked Javascript files down below.
220234 </p>
221235 <ul class="table-of-contents">
236236+ <li><a href="elements/#artwork">Artwork</a></li>
222237 <li><a href="elements/#configurators">Configurators</a></li>
223238 <li><a href="elements/#engines">Engines</a></li>
224239 <li><a href="elements/#input">Input</a></li>
···237252 <!-- ELEMENTS -->
238253 <section>
239254 <div class="columns">
255255+ {{ await comp.element({
256256+ title: "Artwork",
257257+ items: artwork,
258258+ content: `
259259+ Artwork sources for tracks. Each implements a <code>get(track)</code> action and returns artwork bytes or null. Use an artwork configurator to combine multiple sources.
260260+ `
261261+ }) }}
262262+240263 {{ await comp.element({
241264 title: "Configurators",
242265 items: configurators,