A music player that connects to your cloud/distributed storage. diffuse.sh
Something went wrong. Try again.
824 B · 32 lines
JavaScript
123456789101112131415161718192021222324252627282930313233import { ostiary, rpc, workerProxy } from "~/common/worker.js";
/** * @import {ActionsWithTunnel, ProxiedActions} from "~/common/worker.d.ts" * @import {InputActions} from "@specs/components/input/types.d.ts" * @import {Actions} from "@specs/components/artwork/types.d.ts" */
////////////////////////////////////////////// ACTIONS////////////////////////////////////////////
/** * @type {ActionsWithTunnel<Actions>['get']} */export async function get({ data: track, ports }) { /** @type {ProxiedActions<InputActions>} */ const input = workerProxy(() => { ports.input.start(); return ports.input; });
return await input.artwork(track.uri);}
////////////////////////////////////////////// ⚡️////////////////////////////////////////////
ostiary((context) => { rpc(context, { get });});