A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: process sources after adding a source

+22 -4
+9 -2
src/common/constituents/foundation.js
··· 199 199 return findExistingOrAdd(o); 200 200 } 201 201 202 - function processTracks() { 202 + /** 203 + * @param {Object} opts - Options 204 + * @param {boolean} [opts.disableWhenReady] - Whether to disable processing when ready. 205 + */ 206 + function processTracks(opts = { disableWhenReady: false }) { 203 207 const i = input(); 204 208 const o = output(); 205 209 const m = metadata(); ··· 209 213 opt.setAttribute("input-selector", i.selector); 210 214 opt.setAttribute("output-selector", o.selector); 211 215 opt.setAttribute("metadata-processor-selector", m.selector); 212 - opt.toggleAttribute("process-when-ready"); 216 + 217 + if (!opts.disableWhenReady) { 218 + opt.toggleAttribute("process-when-ready"); 219 + } 213 220 214 221 return findExistingOrAdd(opt); 215 222 }
-1
src/components/orchestrator/process-tracks/element.js
··· 2 2 import { signal, untracked } from "@common/signal.js"; 3 3 4 4 /** 5 - * @import {Track} from "@definitions/types.d.ts" 6 5 * @import {ProxiedActions} from "@common/worker.d.ts" 7 6 * @import {InputElement} from "@components/input/types.d.ts" 8 7 * @import {OutputElement} from "@components/output/types.d.ts"
-1
src/components/orchestrator/sources/element.js
··· 3 3 import { signal } from "@common/signal.js"; 4 4 5 5 /** 6 - * @import {Track} from "@definitions/types.d.ts" 7 6 * @import {InputElement, Source} from "@components/input/types.d.ts" 8 7 * @import {OutputElement} from "@components/output/types.d.ts" 9 8 */
+13
src/themes/webamp/configurators/input/index.js
··· 1 1 import foundation from "@common/constituents/foundation.js"; 2 2 import InputConfigElement from "@themes/webamp/configurators/input/element.js"; 3 + import { effect } from "@common/signal.js"; 3 4 4 5 const inp = foundation.orchestrator.input(); 5 6 const out = foundation.orchestrator.output(); 7 + const pro = foundation.orchestrator.processTracks({ disableWhenReady: true }); 6 8 const sou = foundation.orchestrator.sources(); 7 9 8 10 const el = new InputConfigElement(); ··· 11 13 el.setAttribute("sources-orchestrator-selector", sou.selector); 12 14 13 15 document.querySelector("#placeholder")?.replaceWith(el); 16 + 17 + // EFFECTS 18 + 19 + let initEffect = false; 20 + 21 + effect(() => { 22 + const _trigger = sou.sources(); 23 + if (out.tracks.state() !== "loaded") return; 24 + if (initEffect) pro.process(); 25 + initEffect = true; 26 + });