[PR #108] [MERGED] fix: only stop playback with new cluster updates #211

Closed
opened 2026-02-28 14:26:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/devgianlu/go-librespot/pull/108
Author: @aykevl
Created: 10/1/2024
Status: Merged
Merged: 10/3/2024
Merged by: @devgianlu

Base: masterHead: fix-stop-on-transfer


📝 Commits (1)

  • ece2e85 fix: only stop playback with new cluster updates

📊 Changes

3 files changed (+35 additions, -3 deletions)

View changed files

📝 cmd/daemon/controls.go (+5 -1)
📝 cmd/daemon/player.go (+8 -1)
📝 cmd/daemon/state.go (+22 -1)

📄 Description

Sometimes the dealer sends a cluster update with active_device_id still set to the old device ID right after sending a transfer command. This would result in the player thinking it was switching away so would need to stop, even though that's an old message.

This fix looks at the timestamp of the last transfer. It only assumes another player has taken over when the cluster update timestamp is newer than the last transfer timestamp.

This fixes https://github.com/devgianlu/go-librespot/issues/107.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/devgianlu/go-librespot/pull/108 **Author:** [@aykevl](https://github.com/aykevl) **Created:** 10/1/2024 **Status:** ✅ Merged **Merged:** 10/3/2024 **Merged by:** [@devgianlu](https://github.com/devgianlu) **Base:** `master` ← **Head:** `fix-stop-on-transfer` --- ### 📝 Commits (1) - [`ece2e85`](https://github.com/devgianlu/go-librespot/commit/ece2e8536b843a83c6606b67dc4a7d471fe93d17) fix: only stop playback with new cluster updates ### 📊 Changes **3 files changed** (+35 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `cmd/daemon/controls.go` (+5 -1) 📝 `cmd/daemon/player.go` (+8 -1) 📝 `cmd/daemon/state.go` (+22 -1) </details> ### 📄 Description Sometimes the dealer sends a cluster update with active_device_id still set to the old device ID right after sending a transfer command. This would result in the player thinking it was switching away so would need to stop, even though that's an old message. This fix looks at the timestamp of the last transfer. It only assumes another player has taken over when the cluster update timestamp is newer than the last transfer timestamp. This fixes https://github.com/devgianlu/go-librespot/issues/107. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 14:26:16 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-librespot#211
No description provided.