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

chore: remove last.fm from foundation, make it part of scrobble prelude

+21 -13
+2 -2
src/_data/facets.json
··· 114 114 "title": "Scrobble", 115 115 "kind": "prelude", 116 116 "category": "Misc", 117 - "desc": "Enable scrobbling, keep track of what you're listening to." 117 + "desc": "Enable scrobbling, keep track of what you're listening to. Adds support for these scrobblers: Last.fm" 118 118 }, 119 119 { 120 120 "url": "facets/misc/scrobble/last.fm/index.html", 121 121 "title": "Scrobble / Last.fm", 122 122 "category": "Misc", 123 - "desc": "Enable Last.fm scrobbling." 123 + "desc": "Connect to Last.fm to setup the Last.fm scrobbler." 124 124 }, 125 125 { 126 126 "url": "facets/misc/split-view/index.html",
+3 -10
src/common/foundation.js
··· 176 176 * @returns {Promise<ScrobbleElement>} 177 177 */ 178 178 async function scrobbles() { 179 - const [{ default: ScrobblesConfigurator }, { default: LastFmScrobbler }] = 180 - await Promise.all([ 181 - import("~/components/configurator/scrobbles/element.js"), 182 - import("~/components/supplement/last.fm/element.js"), 183 - ]); 179 + const { default: ScrobblesConfigurator } = await import( 180 + "~/components/configurator/scrobbles/element.js" 181 + ); 184 182 185 183 const sc = new ScrobblesConfigurator(); 186 184 sc.setAttribute("group", GROUP); ··· 191 189 if (existing) { 192 190 return /** @type {ScrobbleElement} */ (existing); 193 191 } 194 - 195 - const lastFm = new LastFmScrobbler(); 196 - lastFm.setAttribute("group", GROUP); 197 - 198 - sc.append(lastFm); 199 192 200 193 document.body.append(sc); 201 194 return /** @type {ScrobbleElement} */ (/** @type {unknown} */ (sc));
+16 -1
src/facets/misc/scrobble/index.inline.js
··· 2 2 import { effect } from "~/common/signal.js"; 3 3 4 4 effect(() => { 5 + // Trigger setup when audio is used 5 6 if (foundation.signals.engine.audio()) { 6 - foundation.orchestrator.scrobbleAudio(); 7 + setup(); 7 8 } 8 9 }); 10 + 11 + async function setup() { 12 + await foundation.orchestrator.scrobbleAudio(); 13 + const configurator = await foundation.configurator.scrobbles(); 14 + 15 + // Bundled scrobblers 16 + const { default: LastFmScrobbler } = await import( 17 + "~/components/supplement/last.fm/element.js" 18 + ); 19 + 20 + const lastFm = new LastFmScrobbler(); 21 + lastFm.setAttribute("group", foundation.GROUP); 22 + configurator.append(lastFm); 23 + }