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

"My Episodes" URI not correctly handled: spotify:user:[ID]:collection:your-episodes #441

Open
5 of 8 tasks
chaorace opened this issue May 2, 2024 · 3 comments
Open
5 of 8 tasks
Assignees
Labels
enhancement New feature or request v5 Will be worked on in v5

Comments

@chaorace
Copy link

chaorace commented May 2, 2024

Bug Ticket

Describe the bug

The Spotify "Your Episodes" collection is associated with a user:[ID]:collection URI, similar to the URIs used with the "Liked Songs" collection. For example: spotify:user:1234567890:collection:your-episodes

Currently, when a "Your Episodes" URI is provided to the spotcast service trigger, it fails at the URI validation step without proceeding any further. Instead of rejecting the URI, the validator should recognize "Your Episodes" URIs as valid so that they can be passed along to spotipy's start_playback method. Implementation-wise, "Your Episodes" URIs should follow the exact same codepath as currently used with "Liked Songs" collection URIs.

Troubleshooting

Make sure to validate all the elements before submitting the ticket (Exception to the steps marked as optional)

  • Using latest version of spotcast
  • Using latest stable version of Home Assistant
  • I have setup the Spotify integration in Home Assistant
  • I have renewed my sp_dc and sp_key values and restarted Home Assistant (see README)
  • (optional) I have Spotify Premium
  • (optional) I am using multiple accounts
  • (optional) I'm attaching relevant logs with level debug for component spotcast (see README)
  • (optional) I'm using entity_id in the service call and have tried device_name but the issue remains

Environment

  • Installation type: HA_OS 12.2
  • HA version: 2024.5.0
  • spotcast version: v3.7.3

Configuration

spotcast:
  sp_dc: !secret [SECRETNAME1]
  sp_key: !secret [SECRETNAME2]
  country: US

Service Call

  1. Replace [DEVICE] with any valid device
  2. Replace [ID] with your user ID (identical to the ID found in your "Liked Songs" URI)
  3. Invoke the service call
  4. Note errors in HA log
service: spotcast.start
data:
  uri: spotify:user:[ID]:collection:your-episodes
  device_name: [DEVICE]

Logs

  • normal
2024-05-02 15:37:53.403 ERROR (SyncWorker_5) [custom_components.spotcast.helpers] collection is not a valid type for Spotify request. Please make sure to use the following list ['playlist']
2024-05-02 15:37:53.403 ERROR (SyncWorker_5) [custom_components.spotcast] Invalid URI provided, aborting casting
@chaorace chaorace added the bug Something isn't working label May 2, 2024
@fcusson fcusson added enhancement New feature or request and removed bug Something isn't working labels May 7, 2024
@fcusson
Copy link
Collaborator

fcusson commented Nov 19, 2024

Hi @chaorace, I've been trying to make it work on the new build, where I don't have yet a spotify uri validation and it doesn,t seem to work properly. I am getting a Non Supported Context URI, which is the error the API returns when the URI is valid, but that it cannot use it as a context uri using the Spotify API.

To make sure, I am doing the right things, can you confirm what you are expecting in the ID space of the URI. The Spotify documentation points to it being the account id, so the name of the account, not a unique random char id. Just want to make sure we are talking about the same thing

@fcusson
Copy link
Collaborator

fcusson commented Nov 19, 2024

There is a beta API endpoint to get the currently saved episodes. I checked and it does return the list of episodes in the Your Episodes playlist. The v5 service spotcast.play_custom_context could be used to leverage the results and create a playback of the playlist.

In its current form, unless we can find a valid uri, spotcast would be unable to play this special playlist

@fcusson fcusson added the v5 Will be worked on in v5 label Nov 26, 2024
@fcusson
Copy link
Collaborator

fcusson commented Dec 5, 2024

currently working in beta

@fcusson fcusson modified the milestone: V5 Release Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v5 Will be worked on in v5
Projects
None yet
Development

No branches or pull requests

2 participants