From de4d39c305283f900fd5da5e84b3a840a6ea3e3e Mon Sep 17 00:00:00 2001 From: Steven Vandevelde Date: Thu, 12 Mar 2026 12:08:30 +0100 Subject: [PATCH] fix: scrobble selector attribute name + update element index --- src/common/facets/foundation.js | 2 +- src/components/orchestrator/scrobble-audio/element.js | 8 ++++---- src/index.vto | 8 +++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/common/facets/foundation.js b/src/common/facets/foundation.js index e146ba6c..8c8b6fee 100644 --- a/src/common/facets/foundation.js +++ b/src/common/facets/foundation.js @@ -427,7 +427,7 @@ async function scrobbleAudio() { const sao = new ScrobbleAudioOrchestrator(); sao.setAttribute("group", GROUP); sao.setAttribute("audio-engine-selector", a.selector); - sao.setAttribute("scrobbles-selector", sc.selector); + sao.setAttribute("scrobble-selector", sc.selector); return findExistingOrAdd(sao); } diff --git a/src/components/orchestrator/scrobble-audio/element.js b/src/components/orchestrator/scrobble-audio/element.js index de846cb5..fb81669e 100644 --- a/src/components/orchestrator/scrobble-audio/element.js +++ b/src/components/orchestrator/scrobble-audio/element.js @@ -34,10 +34,10 @@ class ScrobbleAudioOrchestrator extends BroadcastableDiffuseElement { this.audio = query(this, "audio-engine-selector"); /** @type {ScrobbleElement} */ - this.scrobbles = query(this, "scrobbles-selector"); + this.scrobble = query(this, "scrobble-selector"); await customElements.whenDefined(this.audio.localName); - await customElements.whenDefined(this.scrobbles.localName); + await customElements.whenDefined(this.scrobble.localName); this.effect(() => this.#monitorAudio()); } @@ -154,7 +154,7 @@ class ScrobbleAudioOrchestrator extends BroadcastableDiffuseElement { if (this.#trackId !== id || !this.#activeTrack) return; try { - await this.scrobbles?.nowPlaying(this.#activeTrack); + await this.scrobble?.nowPlaying(this.#activeTrack); } catch (err) { console.warn("scrobble: nowPlaying failed", err); } @@ -184,7 +184,7 @@ class ScrobbleAudioOrchestrator extends BroadcastableDiffuseElement { const startedAt = this.#startedAt; try { - await this.scrobbles?.scrobble(track, startedAt); + await this.scrobble?.scrobble(track, startedAt); } catch (err) { console.warn("scrobble: scrobble failed", err); this.#scrobbled = false; diff --git a/src/index.vto b/src/index.vto index 716f8572..93dbef00 100644 --- a/src/index.vto +++ b/src/index.vto @@ -23,7 +23,6 @@ configurators: - url: "components/configurator/scrobbles/element.js" title: "Scrobbles" desc: "Configure multiple scrobblers (music trackers)." - todo: true engines: - url: "components/engine/audio/element.js" @@ -100,6 +99,9 @@ orchestrators: - url: "components/orchestrator/queue-audio/element.js" title: "Queue ⭤ Audio" desc: "Connects the given queue engine to the given audio engine." + - url: "components/orchestrator/scrobble-audio/element.js" + title: "Scrobble ⭤ Audio" + desc: "Connects the audio engine with a scrobbler element. Calls `nowPlaying` when a track starts playing and `scrobble` once the user has listened long enough." - url: "components/orchestrator/sources/element.js" title: "Sources" desc: "Monitor tracks from the given output to form a list of sources based on the input's sources return value." @@ -132,8 +134,8 @@ processors: desc: "Provides a way to search through a collection of tracks, powered by orama.js" supplements: - - title: "Last.fm Scrobbler" - todo: true + - url: "components/supplement/last.fm/element.js" + title: "Last.fm Scrobbler" - title: "ListenBrainz Scrobbler" todo: true - title: "Rocksky Scrobbler" -- knotmirror 0.0.1