Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Smart Shuffle #477

Open
systematicallyrandom opened this issue Nov 25, 2024 · 3 comments
Open

Support for Smart Shuffle #477

systematicallyrandom opened this issue Nov 25, 2024 · 3 comments
Assignees
Labels
dependency issue issue exist because of dependency not the project itself enhancement New feature or request

Comments

@systematicallyrandom
Copy link

Summary

Is it possible to add support for the newer smart shuffle feature that Spotify implemented to replace the radio station feature for playlists?

Use Case

Spotify no longer supports the radio station feature for individual songs or playlists.

Benefits

No response

Potential Solutions

No response

Additional Details

No response

@systematicallyrandom systematicallyrandom added enhancement New feature or request pending-triage The issue is awaiting a review from a maintainer labels Nov 25, 2024
@fcusson
Copy link
Collaborator

fcusson commented Nov 25, 2024

@systematicallyrandom haven't found a way yet to enable smart shuffle. The API Endpoint currently only allows for a boolean value being passed, enabling the shuffle to True or False.

Technically, smart-shuffle is not really a shuffle, its actually 2 functionalities:

  1. Enables Shuffle
  2. Start adding songs to the context using a semi fixed distance with a jitter.

We can see in the playback state actually that smart_shuffle is a completely separate functionality to shuffle

{
  "device": {
    "id": "foo",
    "is_active": true,
    "is_private_session": false,
    "is_restricted": false,
    "name": "bar",
    "type": "Computer",
    "volume_percent": 100,
    "supports_volume": true
  },
  "repeat_state": "context",
  "shuffle_state": true,
  "context": {
    "type": "album",
    "href": "https://api.spotify.com/v1/albums/6yWMN087PgSimbcVmHLEwG",
    "external_urls": {
      "spotify": "https://open.spotify.com/album/6yWMN087PgSimbcVmHLEwG"
    },
    "uri": "spotify:album:6yWMN087PgSimbcVmHLEwG"
  },
  "timestamp": 1732537078305,
  "progress_ms": 319750,
  "is_playing": true,
  "item": {
    "album": {
      "album_type": "album",
      "total_tracks": 15,
      "external_urls": {
        "spotify": "https://open.spotify.com/album/6yWMN087PgSimbcVmHLEwG"
      },
      "href": "https://api.spotify.com/v1/albums/6yWMN087PgSimbcVmHLEwG",
      "id": "6yWMN087PgSimbcVmHLEwG",
      "images": [
        {
          "url": "https://i.scdn.co/image/ab67616d0000b273dce45359981d62e087a29e6f",
          "height": 640,
          "width": 640
        },
        {
          "url": "https://i.scdn.co/image/ab67616d00001e02dce45359981d62e087a29e6f",
          "height": 300,
          "width": 300
        },
        {
          "url": "https://i.scdn.co/image/ab67616d00004851dce45359981d62e087a29e6f",
          "height": 64,
          "width": 64
        }
      ],
      "name": "Ænima",
      "release_date": "1996-09-17",
      "release_date_precision": "day",
      "type": "album",
      "uri": "spotify:album:6yWMN087PgSimbcVmHLEwG",
      "artists": [
        {
          "external_urls": {
            "spotify": "https://open.spotify.com/artist/2yEwvVSSSUkcLeSTNyHKh8"
          },
          "href": "https://api.spotify.com/v1/artists/2yEwvVSSSUkcLeSTNyHKh8",
          "id": "2yEwvVSSSUkcLeSTNyHKh8",
          "name": "TOOL",
          "type": "artist",
          "uri": "spotify:artist:2yEwvVSSSUkcLeSTNyHKh8"
        }
      ],
      "is_playable": true
    },
    "artists": [
      {
        "external_urls": {
          "spotify": "https://open.spotify.com/artist/2yEwvVSSSUkcLeSTNyHKh8"
        },
        "href": "https://api.spotify.com/v1/artists/2yEwvVSSSUkcLeSTNyHKh8",
        "id": "2yEwvVSSSUkcLeSTNyHKh8",
        "name": "TOOL",
        "type": "artist",
        "uri": "spotify:artist:2yEwvVSSSUkcLeSTNyHKh8"
      }
    ],
    "disc_number": 1,
    "duration_ms": 399266,
    "explicit": true,
    "external_ids": {
      "isrc": "USZE19600150"
    },
    "external_urls": {
      "spotify": "https://open.spotify.com/track/0nLOl4fSiBZKGFla5pLUtf"
    },
    "href": "https://api.spotify.com/v1/tracks/0nLOl4fSiBZKGFla5pLUtf",
    "id": "0nLOl4fSiBZKGFla5pLUtf",
    "is_playable": true,
    "name": "Ænema",
    "popularity": 60,
    "preview_url": "https://p.scdn.co/mp3-preview/cb0d70ad5cd62af8f0d6e00953ed0c8ea2d6f89b?cid=cfe923b2d660439caf2b557b21f31221",
    "track_number": 13,
    "type": "track",
    "uri": "spotify:track:0nLOl4fSiBZKGFla5pLUtf",
    "is_local": false
  },
  "currently_playing_type": "track",
  "actions": {
    "disallows": {
      "resuming": true
    }
  },
  "smart_shuffle": false
}

We can see there are a shuffle_state key currently set to true and a smart_shuffle key toward the end set to false in this example.

At the moment, I am only aware of a way of setting the shuffle_state using the API, the smart_shuffle doesn't seem to be possible. A post in the Spotify for Developper section of their Commmunity Forum dating from septeber 2024 seems to indicate this is in fact not possible for the moment.

@fcusson fcusson added dependency issue issue exist because of dependency not the project itself and removed pending-triage The issue is awaiting a review from a maintainer labels Nov 25, 2024
@systematicallyrandom
Copy link
Author

Thanks for looking into it! Hopefully Spotify updates their API soon.

@fcusson
Copy link
Collaborator

fcusson commented Nov 28, 2024

@systematicallyrandom, yeah they technically updated there API recently. They removed features instead of adding some

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency issue issue exist because of dependency not the project itself enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants