···2424 },
2525 "resolve": {
2626 "title": "Resolve",
2727- "description": "Potentially translates a track uri with a matching scheme into a URL pointing at the audio bytes. If it can be resolved that is, otherwise you'll get `undefined`.",
2727+ "description": "Potentially translates a track uri with a matching scheme into a URL pointing at the audio bytes or an audio stream. If it can be resolved that is, otherwise you'll get `undefined`.",
2828 "params_schema": {
2929 "type": "object",
3030 "properties": {
···2727 },
2828 "resolve": {
2929 "title": "Resolve",
3030- "description": "Potentially translates a track uri with a matching scheme into a URL pointing at the audio bytes. If it can be resolved that is, otherwise you'll get `undefined`. Use the `consult` action to get a more detailed answer.",
3030+ "description": "Potentially translates a track uri with a matching scheme into a URL pointing at the audio bytes or an audio stream. If it can be resolved that is, otherwise you'll get `undefined`. Use the `consult` action to get a more detailed answer.",
3131 "params_schema": {
3232 "type": "object",
3333 "properties": {
···3434 },
3535 "resolve": {
3636 "title": "Resolve",
3737- "description": "Potentially translates a track uri with a matching scheme into a URL pointing at the audio bytes. If it can be resolved that is, otherwise you'll get `undefined`. Use the `consult` action to get a more detailed answer.",
3737+ "description": "Potentially translates a track uri with a matching scheme into a URL pointing at the audio bytes or an audio stream. If it can be resolved that is, otherwise you'll get `undefined`. Use the `consult` action to get a more detailed answer.",
3838 "params_schema": {
3939 "type": "object",
4040 "properties": {
···55 "actions": {
66 "fill": {
77 "title": "Fill",
88- "description": "Fill up the queue."
88+ "description": "Fill up the queue.",
99+ "params_schema": {
1010+ "type": "array",
1111+ "items": { "type": "object" },
1212+ "description": "Array of tracks to be used to fill up the queue."
1313+ }
914 }
1015 }
1116}
+5-5
src/scripts/themes/webamp/index.ts
···11import Webamp from "webamp";
22import { URLTrack } from "webamp";
3344-import type { Output, Track } from "@applets/core/types.d.ts";
55-import { applet, waitUntilAppletIsReady } from "../../theme.ts";
44+import type { ResolvedUri, Track } from "@applets/core/types.d.ts";
55+import { applet } from "../../theme.ts";
6677////////////////////////////////////////////
88// 🎨 Styles
···5555 // TODO: Ideally the URL should only be resolved when needed,
5656 // but webamp doesn't allow for that.
5757 // Maybe you could work around it with a service worker.
5858- const url = await configurator.input.sendAction<string | undefined>(
5858+ const resGet = await configurator.input.sendAction<ResolvedUri>(
5959 "resolve",
6060 { method: "GET", uri: track.uri },
6161 {
···6363 },
6464 );
65656666- if (!url) return acc;
6666+ if (!resGet) return acc;
67676868 const urlTrack: URLTrack = {
6969- url,
6969+ url: resGet.url,
7070 metaData: {
7171 title: track.tags?.title || "",
7272 artist: track.tags?.artist || "",