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: sync scoped-tracks signal values with leader

+36 -6
+1 -1
src/components/orchestrator/process-tracks/element.js
··· 73 73 74 74 // Sync #performedInitialProcess with leader 75 75 actions.getPerfInit().then((val) => { 76 - this.#performedInitialProcess.set(val); 76 + this.#performedInitialProcess.value = val; 77 77 }); 78 78 } 79 79
+33 -5
src/components/orchestrator/scoped-tracks/element.js
··· 3 3 query, 4 4 queryOptional, 5 5 } from "@common/element.js"; 6 - import { computed, signal } from "@common/signal.js"; 6 + import { batch, computed, signal } from "@common/signal.js"; 7 7 import { filterByPlaylist } from "@common/playlist.js"; 8 8 import { trackURIBase, uniqueTrackURIs } from "@common/track.js"; 9 9 ··· 59 59 // Broadcast if needed 60 60 if (this.hasAttribute("group")) { 61 61 const actions = this.broadcast(this.nameWithGroup, { 62 + getTracksAvailable: { 63 + strategy: "leaderOnly", 64 + fn: this.#tracksAvailable.get, 65 + }, 66 + getTracksSearch: { 67 + strategy: "leaderOnly", 68 + fn: this.#tracksSearch.get, 69 + }, 70 + getTracksFinal: { 71 + strategy: "leaderOnly", 72 + fn: this.#tracksFinal.get, 73 + }, 74 + setTracksAvailable: { 75 + strategy: "replicate", 76 + fn: this.#tracksAvailable.set, 77 + }, 62 78 setTracksSearch: { 63 79 strategy: "replicate", 64 80 fn: this.#tracksSearch.set, ··· 69 85 }, 70 86 }); 71 87 72 - if (actions) { 73 - this.#tracksSearch.set = actions.setTracksSearch; 74 - this.#tracksFinal.set = actions.setTracksFinal; 75 - } 88 + if (!actions) return; 89 + 90 + this.#tracksAvailable.set = actions.setTracksAvailable; 91 + this.#tracksSearch.set = actions.setTracksSearch; 92 + this.#tracksFinal.set = actions.setTracksFinal; 93 + 94 + // Sync signal state with leader 95 + Promise.all([ 96 + actions.getTracksAvailable(), 97 + actions.getTracksSearch(), 98 + actions.getTracksFinal(), 99 + ]).then(([available, search, final]) => batch(() => { 100 + this.#tracksAvailable.value = available; 101 + this.#tracksSearch.value = search; 102 + this.#tracksFinal.value = final; 103 + })); 76 104 } 77 105 78 106 // Super
+2
src/themes/webamp/browser/element.js
··· 228 228 const playlist = this.$scope.value?.playlist(); 229 229 const searchTerm = this.$scope.value?.searchTerm() ?? ""; 230 230 231 + console.log(tracks, this.$provider.value) 232 + 231 233 // Virtual list 232 234 const totalTracks = tracks.length; 233 235 const { startIndex, endIndex: rawEnd } = this.#computeWindow();