[GH-ISSUE #515] Podcasts/Shows not being fetched properly #168

Closed
opened 2026-02-27 20:23:31 +03:00 by kerem · 2 comments
Owner

Originally created by @m4r1vs on GitHub (Jan 16, 2025).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/515

Describe the bug
The spotify API returns "null" as part of the "items" for some Podcasts (for example Lateral by Tom Scott). The response JSON looks like this:

...ITEMS[]...
      "is_playable": true,
      "language": "en",
      "languages": [
        "en"
      ],
      "name": "118: The wrong way wheel",
      "release_date": "2025-01-10",
      "release_date_precision": "day",
      "resume_point": {
        "fully_played": true,
        "resume_position_ms": 0
      },
      "type": "episode",
      "uri": "spotify:episode:2OcsbZmwFB0GBiuLQHsEQU"
    },
    null <=== WEIRD NULL
  ],
...METADATA...

To Reproduce
Steps to reproduce the behavior:

  1. Clone my fork of spotify_player and cd into https://github.com/m4r1vs/spotify-player/tree/master/debugging
  2. cargo run
  3. Notice the error
  4. Notice that using Option<SimpliefiedEpisode> fixes this.

Expected behavior
I expect all episodes to be loaded properly.

Log/Output data
Serde is not able to parse the json.

Additional context
I use spotify_player for music playback and have long been plagued by some podcasts not loading. Now that I have examps coming up, it's the perfect time to procrastinate on open source lol

Originally created by @m4r1vs on GitHub (Jan 16, 2025). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/515 **Describe the bug** The spotify API returns "null" as part of the "items" for some Podcasts (for example Lateral by Tom Scott). The response JSON looks like this: ```json ...ITEMS[]... "is_playable": true, "language": "en", "languages": [ "en" ], "name": "118: The wrong way wheel", "release_date": "2025-01-10", "release_date_precision": "day", "resume_point": { "fully_played": true, "resume_position_ms": 0 }, "type": "episode", "uri": "spotify:episode:2OcsbZmwFB0GBiuLQHsEQU" }, null <=== WEIRD NULL ], ...METADATA... ``` **To Reproduce** Steps to reproduce the behavior: 1. Clone my fork of spotify_player and cd into https://github.com/m4r1vs/spotify-player/tree/master/debugging 2. `cargo run` 3. Notice the error 4. Notice that using `Option<SimpliefiedEpisode>` fixes this. **Expected behavior** I expect all episodes to be loaded properly. **Log/Output data** Serde is not able to parse the json. **Additional context** I use spotify_player for music playback and have long been plagued by some podcasts not loading. Now that I have examps coming up, it's the perfect time to procrastinate on open source lol
kerem 2026-02-27 20:23:31 +03:00
Author
Owner

@ramsayleung commented on GitHub (Jan 18, 2025):

It seems that Spotify has changed the behavior of their APIs again, I've encountered this problem more times than I can count. Originally, the API returned a SimplifiedEpisode. If an episode was null, it would skip it and return nothing.

To address this issue, I have an idea: instead of directly updating the return type from SimplifiedEpisode to Option<SimplifiedEpisode>, I prefer to introduce a wire version that is flexible and adaptable to any changes Spotify makes. This approach allows us to continue using SimplifiedEpisode as the facade version without introducing breaking changes for library users.

<!-- gh-comment-id:2600257747 --> @ramsayleung commented on GitHub (Jan 18, 2025): It seems that Spotify has changed the behavior of their APIs again, I've encountered this problem more times than [I can count](https://github.com/ramsayleung/rspotify/issues?q=sort%3Aupdated-desc%20is%3Aissue%20JSON). Originally, the API returned a SimplifiedEpisode. If an episode was null, it would skip it and return nothing. To address this issue, I have an idea: instead of directly updating the return type from `SimplifiedEpisode` to `Option<SimplifiedEpisode>`, I prefer to introduce a wire version that is flexible and adaptable to any changes Spotify makes. This approach allows us to continue using `SimplifiedEpisode` as the facade version without introducing breaking changes for library users.
Author
Owner

@ramsayleung commented on GitHub (Jul 8, 2025):

Closing this ticket as it's resolved by this PR: https://github.com/ramsayleung/rspotify/pull/526

<!-- gh-comment-id:3046902365 --> @ramsayleung commented on GitHub (Jul 8, 2025): Closing this ticket as it's resolved by this PR: https://github.com/ramsayleung/rspotify/pull/526
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/rspotify#168
No description provided.