Skip to content

feat: add support for DJ mode #287

@hkcryos

Description

@hkcryos

Spotify's AI DJ mode uses a special context type (lexicon_set_type: your_dj) that doesn't work with the standard context resolution. The current implementation fails because:

  1. DJ tracks have an empty uri field in ContextTrack - the actual URI is in metadata["canonical_track_uri"]
  2. The context URL points to a session-specific lexicon endpoint that returns 404 from other sessions
  3. No transfer commands are sent for track advancement in DJ mode

I've got this working locally and am enjoying it now. My implementation does it like this:

  • Adding ContextTrackUri() helper that falls back to canonical_track_uri metadata
  • Creating a single-track context from TransferState.Playback.CurrentTrack for DJ transfers
  • Caching NextTracks from ClusterUpdate messages (the service broadcasts the full queue before transfer)
  • Using the cached tracks to advance playback when a DJ track ends
  • Skipping autoplay resolution for DJ contexts (that gives a 404)

I haven't looked at the TTS DJ-speak between tracks (I don't like that!) or the cross-fading between tracks (again, I dislike it, so didn't implement it).

Happy to commit a branch if there's interest in supporting this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions