[PR #124] [CLOSED] Support smart shuffle #225

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

📋 Pull Request Information

Original PR: https://github.com/devgianlu/go-librespot/pull/124
Author: @devgianlu
Created: 10/13/2024
Status: Closed

Base: masterHead: smart-shuffle


📝 Commits (1)

  • 0c2ef74 feat: support smart shuffle

📊 Changes

2 files changed (+78 additions, -5 deletions)

View changed files

📝 cmd/daemon/player.go (+51 -5)
📝 tracks/tracks.go (+27 -0)

📄 Description

This PR aims at adding support for Smart Shuffle. It is very early stages as some reverse engineering is required.

Spotify introduced the concept of signals and lenses. For Smart Shuffle we send a reset signal to the playlist with the enhance lense. The result is a list of ~310 tracks for a ~210 tracks playlist, but it is not clear where they should go. There is a suspicious metadata key called shuffle.distribution that may play a role in this. I have also noticed that the shuffle seed has been added to the session state.

There might be some refactoring required to handle the "injection" of tracks inside the current tracks list. Perhaps something similar to how the queue works?


🔄 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/124 **Author:** [@devgianlu](https://github.com/devgianlu) **Created:** 10/13/2024 **Status:** ❌ Closed **Base:** `master` ← **Head:** `smart-shuffle` --- ### 📝 Commits (1) - [`0c2ef74`](https://github.com/devgianlu/go-librespot/commit/0c2ef746059c093500324bf6a5565a9781411e59) feat: support smart shuffle ### 📊 Changes **2 files changed** (+78 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `cmd/daemon/player.go` (+51 -5) 📝 `tracks/tracks.go` (+27 -0) </details> ### 📄 Description This PR aims at adding support for Smart Shuffle. It is very early stages as some reverse engineering is required. Spotify introduced the concept of signals and lenses. For Smart Shuffle we send a `reset` signal to the playlist with the `enhance` lense. The result is a list of ~310 tracks for a ~210 tracks playlist, but it is not clear where they should go. There is a suspicious metadata key called `shuffle.distribution` that may play a role in this. I have also noticed that the shuffle seed [has been added](https://github.com/devgianlu/go-librespot/commit/d977b7593a9cce2a3fd8987089268c70dc216b3a#diff-0298318e7009d7db940c19c35c3219775c10ab23725203a64c2b2607972b2ff0R147) to the session state. There might be some refactoring required to handle the "injection" of tracks inside the current tracks list. Perhaps something similar to how the queue works? --- <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:18 +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#225
No description provided.