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: don't process again when opening a facet and there's already a group in which processing occured

+24 -4
+3 -1
src/common/element.js
··· 50 50 * @param {() => void} fn 51 51 */ 52 52 effect(fn) { 53 - this.#disposables.push(effect(fn)); 53 + const unregister = effect(fn); 54 + this.#disposables.push(unregister); 55 + return unregister; 54 56 } 55 57 56 58 /** */
+20 -3
src/components/orchestrator/process-tracks/element.js
··· 38 38 // SIGNALS 39 39 40 40 #isProcessing = signal(false); 41 + #performedInitialProcess = signal(false); 41 42 #progress = signal(/** @type {Progress} */ ({ processed: 0, total: 0 })); 42 43 43 44 // STATE ··· 54 55 // Broadcast if needed 55 56 if (this.hasAttribute("group")) { 56 57 const actions = this.broadcast(this.nameWithGroup, { 58 + perfInit: { 59 + strategy: "replicate", 60 + fn: this.#performedInitialProcess.set, 61 + }, 57 62 process: { strategy: "leaderOnly", fn: this.process }, 58 63 }); 59 64 60 - if (actions) this.process = actions.process; 65 + if (actions) { 66 + this.process = actions.process; 67 + this.#isProcessing.set = actions.perfInit; 68 + } 61 69 } 62 70 63 71 // Super ··· 87 95 listen("progress", this.#progress.set, link); 88 96 this.#proxy.progress().then(this.#progress.set); 89 97 90 - // Process whenever tracks are initially loaded 98 + // Process whenever tracks are initially loaded; 99 + // unless already done so (possibly through another instance of this element) 91 100 if (this.hasAttribute("process-when-ready")) { 92 - this.effect(() => { 101 + const unregister = this.effect(() => { 93 102 const state = output.tracks.state(); 94 103 if (state !== "loaded") return; 95 104 105 + if (this.#performedInitialProcess.value) { 106 + unregister(); 107 + return; 108 + } 109 + 110 + this.#performedInitialProcess.value = true; 111 + 96 112 const skip = /** @type {any} */ (import.meta).env 97 113 ?.DISABLE_AUTOMATIC_TRACKS_PROCESSING ?? false; 98 114 if (skip) return; 99 115 100 116 untracked(() => this.process()); 117 + unregister(); 101 118 }); 102 119 } 103 120 }
+1
src/facets/tools/auto-queue.html.txt
··· 55 55 56 56 // Setup 57 57 foundation.features.fillQueueAutomatically(); 58 + foundation.features.processInputs(); 58 59 59 60 const queue = foundation.engine.queue(); 60 61 const repeatShuffle = foundation.engine.repeatShuffle();