[GH-ISSUE #825] When playing songs from Liked songs page: Cannot determine the current page's context #1430

Closed
opened 2026-03-14 14:54:59 +03:00 by kerem · 5 comments
Owner

Originally created by @wiraki on GitHub (Sep 4, 2025).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/825

Describe the bug
When I first go to Liked Songs (g y) and start playing songs, if I navigate away (for example going to Artist page of the current song) and then use g Space to go back to current context, it fails to do bring me back to Liked Songs and says Cannot determine the current page's context

To Reproduce
See description.

Expected behaviour
I would expect g Space to bring me back to Liked Songs. Let me know if what I am seeing is the normal expected behavior.

Log and backtrace

Let me know if a log is necessary (by the way, doesn't it include confidential tokens etc.?)

Backtrace is empty.

Environment

  • OS: Pop!_OS 22.04 LTS x86_64
  • Application version: 0.21.0 -> Built from commit 77af13b48b2a03e61fef1cffea899929057551dc
  • Application features: streaming,media-control,pulseaudio-backend,image,notify,fzf
Originally created by @wiraki on GitHub (Sep 4, 2025). Original GitHub issue: https://github.com/aome510/spotify-player/issues/825 **Describe the bug** When I first go to Liked Songs (`g y`) and start playing songs, if I navigate away (for example going to Artist page of the current song) and then use `g Space` to go back to current context, it fails to do bring me back to Liked Songs and says `Cannot determine the current page's context` **To Reproduce** See description. **Expected behaviour** I would expect `g Space` to bring me back to Liked Songs. Let me know if what I am seeing is the normal expected behavior. **Log and backtrace** Let me know if a log is necessary (by the way, doesn't it include confidential tokens etc.?) Backtrace is empty. **Environment** - OS: Pop!_OS 22.04 LTS x86_64 - Application version: 0.21.0 -> Built from commit `77af13b48b2a03e61fef1cffea899929057551dc` - Application features: `streaming,media-control,pulseaudio-backend,image,notify,fzf`
kerem 2026-03-14 14:54:59 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@aome510 commented on GitHub (Sep 5, 2025):

I would expect g Space to bring me back to Liked Songs. Let me know if what I am seeing is the normal expected behavior.

this is expected cause when you play from the Liked Tracks page, it just creates a tracks playback consisting of a subset of tracks there. g space only supports context playback, i.e. when you play from playlist/album

<!-- gh-comment-id:3259587210 --> @aome510 commented on GitHub (Sep 5, 2025): > I would expect g Space to bring me back to Liked Songs. Let me know if what I am seeing is the normal expected behavior. this is expected cause when you play from the **Liked Tracks** page, it just creates a **tracks** playback consisting of a subset of tracks there. `g space` only supports **context** playback, i.e. when you play from playlist/album
Author
Owner

@wiraki commented on GitHub (Sep 5, 2025):

Thanks for the fast reply!

it just creates a tracks playback consisting of a subset of tracks there.

I was not aware of that. Do I understand correctly that if I have liked e.g. 500 tracks, when I start playback from the Liked Tracks page it creates a subset of X tracks?

If that is correct:

  • How is the number of tracks in the subset determined?
  • Is this how the official client function and I never noticed?

I am sorry if this is documented somewhere, I tried to find it but I may have missed it. Feel free to just point me in the right direction.

<!-- gh-comment-id:3259967627 --> @wiraki commented on GitHub (Sep 5, 2025): Thanks for the fast reply! > it just creates a tracks playback consisting of a subset of tracks there. I was not aware of that. Do I understand correctly that if I have liked e.g. 500 tracks, when I start playback from the Liked Tracks page it creates a subset of X tracks? If that is correct: - How is the number of tracks in the subset determined? - Is this how the official client function and I never noticed? I am sorry if this is documented somewhere, I tried to find it but I may have missed it. Feel free to just point me in the right direction.
Author
Owner

@aome510 commented on GitHub (Sep 6, 2025):

I was not aware of that. Do I understand correctly that if I have liked e.g. 500 tracks, when I start playback from the Liked Tracks page it creates a subset of X tracks?

Yes and it depends on the song that you start the playback with. The logic is defined in github.com/aome510/spotify-player@77af13b48b/spotify_player/src/state/model.rs (L709-L719)

in case you're interested. tldr, it will pick tracks_playback_limit (default 50) songs around the start track to initiate the playback. If you increase this number too high, Spotify API will return an error.

Is this how the official client function and I never noticed?

I'm not sure. If I start a liked tracks playback using official Spotify app, got this as a returned context

> spotify_player get key playback | jq .context
{
  "uri": "spotify:user:31bewedqaetpovv3yqnw44jtphsy:collection",
  "href": "https://api.spotify.com/v1/me/tracks",
  "external_urls": {
    "spotify": "https://open.spotify.com/collection/tracks"
  },
  "type": "collection"
}

and it seems I can also use spotify:user:31bewedqaetpovv3yqnw44jtphsy:collection as a context_uri to start a playback in https://developer.spotify.com/documentation/web-api/reference/start-a-users-playback 🤔 even Spotify says it only supports artist/playlist/album as a context:

Image

Obviously, rspotify only allows to use artist/playlist/album as a context: https://docs.rs/rspotify/latest/rspotify/clients/trait.OAuthClient.html#method.start_context_playback

That said, I think it's definitely possible implement something in spotify_player to support liked tracks as a context

<!-- gh-comment-id:3260163579 --> @aome510 commented on GitHub (Sep 6, 2025): > I was not aware of that. Do I understand correctly that if I have liked e.g. 500 tracks, when I start playback from the Liked Tracks page it creates a subset of X tracks? Yes and it depends on the song that you start the playback with. The logic is defined in https://github.com/aome510/spotify-player/blob/77af13b48b2a03e61fef1cffea899929057551dc/spotify_player/src/state/model.rs#L709-L719 in case you're interested. tldr, it will pick `tracks_playback_limit` (default 50) songs around the start track to initiate the playback. If you increase this number too high, Spotify API will return an error. > Is this how the official client function and I never noticed? I'm not sure. If I start a liked tracks playback using official Spotify app, got this as a returned context ``` > spotify_player get key playback | jq .context { "uri": "spotify:user:31bewedqaetpovv3yqnw44jtphsy:collection", "href": "https://api.spotify.com/v1/me/tracks", "external_urls": { "spotify": "https://open.spotify.com/collection/tracks" }, "type": "collection" } ``` and it seems I can also use `spotify:user:31bewedqaetpovv3yqnw44jtphsy:collection` as a `context_uri` to start a playback in https://developer.spotify.com/documentation/web-api/reference/start-a-users-playback 🤔 even Spotify says it only supports artist/playlist/album as a context: <img width="467" height="257" alt="Image" src="https://github.com/user-attachments/assets/ded12a17-9897-4dbe-8f83-0fa4cb5aa69c" /> Obviously, `rspotify` only allows to use artist/playlist/album as a context: https://docs.rs/rspotify/latest/rspotify/clients/trait.OAuthClient.html#method.start_context_playback That said, I think it's definitely possible implement something in `spotify_player` to support liked tracks as a context
Author
Owner

@aome510 commented on GitHub (Sep 6, 2025):

That said, I think it's definitely possible implement something in spotify_player to support liked tracks as a context

fwiw, I do plan to improve the usability of tracks context in spotify_player (so that tracks playback will show up in currently playing context page) so this liked-tracks integration will probably be included as part of the work

<!-- gh-comment-id:3260167321 --> @aome510 commented on GitHub (Sep 6, 2025): > That said, I think it's definitely possible implement something in spotify_player to support liked tracks as a context fwiw, I do plan to improve the usability of `tracks` context in `spotify_player` (so that `tracks` playback will show up in currently playing context page) so this liked-tracks integration will probably be included as part of the work
Author
Owner

@wiraki commented on GitHub (Sep 6, 2025):

Thanks for the details aome510, TIL !

I leave it up to you whether to close this issue or leave it open for future implementation.

<!-- gh-comment-id:3261779348 --> @wiraki commented on GitHub (Sep 6, 2025): Thanks for the details aome510, TIL ! I leave it up to you whether to close this issue or leave it open for future implementation.
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/spotify-player#1430
No description provided.