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

Context type "collectionyourepisodes" throws an error when retrieved using the current_playback function #398

Closed
NDoolan360 opened this issue Apr 10, 2023 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@NDoolan360
Copy link

Describe the bug
The context type "collectionyourepisodes" throws an error when retrieved using the current_playback function.

To Reproduce
Steps to reproduce the behavior:

  1. Create any app using rspotify.
  2. Using the Spotify desktop app (or other) play an episode from the "Your Episodes" playlist.
  3. Have the app created in 1. call the current_playback function.
  4. See error

Expected behavior
The model is able to handle all types that it could receive for the context type.

Log/Output data

ParseJson(
    Error("unknown variant `collectionyourepisodes`, expected one of `artist`, `album`, `track`, `playlist`, `user`, `show`, `episode`, `collection`", line: 19, column: 37),
)

Additional context
Not sure if this is an issue with rspotify or with the Spotify API.

@NDoolan360 NDoolan360 added bug Something isn't working help wanted Extra attention is needed labels Apr 10, 2023
@ramsayleung
Copy link
Owner

ramsayleung commented Apr 10, 2023

From your error message, it looks like that Spotify has added a new variant collectionyourepisodes for the Type Enum.

Would you like to give me the response of your request with web console, so I could write a test case for this issue?

https://developer.spotify.com/documentation/web-api/reference/get-information-about-the-users-current-playback

@NDoolan360
Copy link
Author

This is the state returned when playing an episode from the "Your Episodes" playlist
(truncated some info for both privacy and brevity).

    "actions": {
        "disallows": {
            "resuming": true
        }
    },
    "context": {
        "external_urls": {
            "spotify": "https://open.spotify.com/collection/episodes"
        },
        "href": "https://api.spotify.com/v1/me/episodes",
        "type": "collectionyourepisodes",
        "uri": "spotify:user:<username>:collection:your-episodes"
    },
    "currently_playing_type": "episode",
    "device": {
        ...
    },
    "is_playing": true,
    "item": {
        "is_externally_hosted": false,
        "is_playable": true,
        "type": "episode",
        ...
    },
    "progress_ms": 3515556,
    "repeat_state": "context",
    "shuffle_state": true,
    "timestamp": 1683852851109
}```

@ramsayleung
Copy link
Owner

This problem has been fixed, you could give v0.11.7 a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants