diff --git a/src/pages/input/s3/_applet.astro b/src/pages/input/s3/_applet.astro index daff2be..32aae3e 100644 --- a/src/pages/input/s3/_applet.astro +++ b/src/pages/input/s3/_applet.astro @@ -334,7 +334,7 @@ async function loadBuckets() { const i = await IDB.get(IDB_BUCKETS); - return i; + return i ? i : {}; } function parseURI(uriString: string): Bucket | undefined { diff --git a/src/pages/orchestrator/single-queue/_applet.astro b/src/pages/orchestrator/single-queue/_applet.astro index 942f95d..0b58b4f 100644 --- a/src/pages/orchestrator/single-queue/_applet.astro +++ b/src/pages/orchestrator/single-queue/_applet.astro @@ -15,6 +15,12 @@ const context = applets.register(); // Applet connections + const configurator = { + input: await applet("../../configurator/input", { + context: self.top || self.parent, + }), + }; + const engine = { audio: await applet("../../engine/audio", { context: self.top || self.parent, @@ -35,19 +41,16 @@ //////////////////////////////////////////// context.setActionHandler("fill", fill); - function fill() { - // TODO: Need to translate the semi-permanent track uri - // into a usable audio URL. - engine.queue.sendAction( - "add", - orchestrator.output.data.tracks.collection.map((track: Track) => { - return { - expiresAt: Infinity, - id: track.id, - url: track.uri, - }; - }), - ); + async function fill() { + const queueItems = orchestrator.output.data.tracks.collection.map(async (track: Track) => { + return { + expiresAt: Infinity, // TODO + id: track.id, + url: await configurator.input.sendAction("resolve", { method: "GET", uri: track.uri }), + }; + }); + + await engine.queue.sendAction("add", await Promise.all(queueItems)); } //////////////////////////////////////////// diff --git a/src/scripts/themes/pilot/index.ts b/src/scripts/themes/pilot/index.ts index 240a4cd..3887763 100644 --- a/src/scripts/themes/pilot/index.ts +++ b/src/scripts/themes/pilot/index.ts @@ -15,6 +15,7 @@ import type * as QueueEngine from "@applets/engine/queue/types.d.ts"; import type * as AudioUI from "@applets/themes/pilot/ui/audio/types.d.ts"; const _configurator = { + input: await applet("../../configurator/input"), output: await applet("../../configurator/output"), }; @@ -23,10 +24,6 @@ const engine = { queue: await applet("../../engine/queue"), }; -const input = { - nativeFs: await applet("../../input/native-fs"), -}; - const _orchestrator = { input: await applet("../../orchestrator/input-cache"), output: await applet("../../orchestrator/output-management"), diff --git a/src/styles/themes/pilot/index.css b/src/styles/themes/pilot/index.css index 2ad46e2..2f15f2d 100644 --- a/src/styles/themes/pilot/index.css +++ b/src/styles/themes/pilot/index.css @@ -54,6 +54,7 @@ iframe[src*="/configurator/"], iframe[src*="/engine/"], iframe[src*="/input/"], iframe[src*="/orchestrator/"], +iframe[src*="/processor/"], iframe[src*="/output/"] { height: 0; left: 110vw;