Skip to content

Commit

Permalink
deploy: f9435cb
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowsink committed Jan 2, 2025
1 parent 5045e67 commit 1b76a0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lastfm/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4068,8 +4068,16 @@ else if (this.#lastUsername !== nextUser || !this.#socket && !this.#pendingSocke
path: "/https://listenbrainz.org/socket.io",
transports: ["websocket"]
});
this.#pendingSocket.on("connect", () => this.#onConnect(nextUser));
this.#pendingSocket.once("connect", () => this.#onConnect(nextUser));
this.#pendingSocket.on("playing_now", (pn) => this.#playingNowHandler(pn));
const s = this.#pendingSocket;
const intCode = setInterval(() => {
if (s !== this.#pendingSocket && s !== this.#socket) return clearInterval(intCode);
if (!s.connected) {
s.connect();
s.once("connect", () => s.emit("json", { user: nextUser }));
}
}, 1e4);
}
#onConnect(nextUser) {
this.#socket?.close();
Expand Down
2 changes: 1 addition & 1 deletion lastfm/plugin.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"Last.fm Presence","author":"Yellowsink","description":"Shows your Last.fm now listening as a presence","hash":"b3038fdaced2f46878abbfe351270fe4"}
{"name":"Last.fm Presence","author":"Yellowsink","description":"Shows your Last.fm now listening as a presence","hash":"2a68f43389009f3a8c93a46a0b9aa34d"}

0 comments on commit 1b76a0f

Please sign in to comment.