[GH-ISSUE #320] Fetched playlist contains Track items for episodes #100

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

Originally created by @hrkfdn on GitHub (May 28, 2022).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/320

Describe the bug
A playlist of tracks and podcast episodes only contains PlayableItem::Track items.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new playlist
  2. Add music track to playlist
  3. Add podcast episode to playlist
  4. Fetch playlist using i.e. playlist_items_manual()

Expected behavior
The playlist should have items typed as PlayableItem::Track and PlayableItem::Episode

Log/Output data
Here's one of the items that should have been a podcast episode but was typed as a track instead:

Track(FullTrack { album: SimplifiedAlbum { album_group: None, album_type: Some("compilation"), artists: [SimplifiedArtist { external_urls: {"spotify": "https://open.spotify.com/show/2Shpxw7dPoxRJCdfFXTWLE"}, href: Some("https://api.spotify.com/v1/shows/2Shpxw7dPoxRJCdfFXTWLE"), id: Some(ArtistId("2Shpxw7dPoxRJCdfFXTWLE")), name: "Philosophize This!" }], available_markets: ["AD", "AE", "AG", "AL", "AM", "AO", "AR", "AT", "AU", "AZ", "BA", "BB", "BE", "BF", "BG", "BH", "BI", "BJ", "BN", "BO", "BR", "BS", "BT", "BW", "BZ", "CA", "CH", "CI", "CL", "CM", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "ES", "FI", "FJ", "FM", "FR", "GA", "GB", "GD", "GE", "GH", "GM", "GN", "GQ", "GR", "GT", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IS", "IT", "JM", "JO", "JP", "KE", "KH", "KI", "KM", "KN", "KW", "LA", "LB", "LC", "LI", "LR", "LS", "LT", "LU", "LV", "MA", "MC", "ME", "MG", "MH", "MK", "ML", "MN", "MO", "MR", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NZ", "OM", "PA", "PE", "PG", "PH", "PL", "PS", "PT", "PW", "PY", "QA", "RO", "RS", "RW", "SA", "SB", "SC", "SE", "SG", "SI", "SK", "SL", "SM", "SN", "SR", "ST", "SV", "SZ", "TD", "TG", "TH", "TL", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "US", "UY", "UZ", "VC", "VN", "VU", "WS", "XK", "ZA", "ZM", "ZW"], external_urls: {"spotify": "https://open.spotify.com/show/2Shpxw7dPoxRJCdfFXTWLE"}, href: Some("https://api.spotify.com/v1/shows/2Shpxw7dPoxRJCdfFXTWLE"), id: Some(AlbumId("2Shpxw7dPoxRJCdfFXTWLE")), images: [Image { height: Some(640), url: "https://i.scdn.co/image/f07f5f6476583502fac99edd5eb83e99dfaf4633", width: Some(640) }, Image { height: Some(300), url: "https://i.scdn.co/image/b01d89d740d3275d16082b5c5e597b12881bec26", width: Some(300) }, Image { height: Some(64), url: "https://i.scdn.co/image/7c2c22f4fe4d0193c886b297920626c136fccde0", width: Some(64) }], name: "Philosophize This!", release_date: None, release_date_precision: None, restrictions: Some(Restriction { reason: Product }) }, artists: [SimplifiedArtist { external_urls: {"spotify": "https://open.spotify.com/show/2Shpxw7dPoxRJCdfFXTWLE"}, href: Some("https://api.spotify.com/v1/shows/2Shpxw7dPoxRJCdfFXTWLE"), id: Some(ArtistId("2Shpxw7dPoxRJCdfFXTWLE")), name: "Philosophize This!" }], available_markets: ["AD", "AE", "AG", "AL", "AM", "AO", "AR", "AT", "AU", "AZ", "BA", "BB", "BE", "BF", "BG", "BH", "BI", "BJ", "BN", "BO", "BR", "BS", "BT", "BW", "BZ", "CA", "CH", "CI", "CL", "CM", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "ES", "FI", "FJ", "FM", "FR", "GA", "GB", "GD", "GE", "GH", "GM", "GN", "GQ", "GR", "GT", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IS", "IT", "JM", "JO", "JP", "KE", "KH", "KI", "KM", "KN", "KW", "LA", "LB", "LC", "LI", "LR", "LS", "LT", "LU", "LV", "MA", "MC", "ME", "MG", "MH", "MK", "ML", "MN", "MO", "MR", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NZ", "OM", "PA", "PE", "PG", "PH", "PL", "PS", "PT", "PW", "PY", "QA", "RO", "RS", "RW", "SA", "SB", "SC", "SE", "SG", "SI", "SK", "SL", "SM", "SN", "SR", "ST", "SV", "SZ", "TD", "TG", "TH", "TL", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "US", "UY", "UZ", "VC", "VN", "VU", "WS", "XK", "ZA", "ZM", "ZW"], disc_number: 0, duration: 1675.68s, explicit: false, external_ids: {"spotify": "https://open.spotify.com/episode/3eCVbzwX4rZvwmcrGwmhHs"}, external_urls: {"spotify": "https://open.spotify.com/episode/3eCVbzwX4rZvwmcrGwmhHs"}, href: Some("https://api.spotify.com/v1/episodes/3eCVbzwX4rZvwmcrGwmhHs"), id: Some(TrackId("3eCVbzwX4rZvwmcrGwmhHs")), is_local: false, is_playable: Some(false), linked_from: None, restrictions: None, name: "Episode #165 ... Ralph Waldo Emerson - Nature and Other Things", popularity: 0, preview_url: Some("https://p.scdn.co/mp3-preview/f20fa210a955025247b33d5087fba650d5b046b9"), track_number: 0 })

Note the URIs pointing to a show object.

Originally created by @hrkfdn on GitHub (May 28, 2022). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/320 **Describe the bug** A playlist of tracks and podcast episodes only contains `PlayableItem::Track` items. **To Reproduce** Steps to reproduce the behavior: 1. Create a new playlist 2. Add music track to playlist 3. Add podcast episode to playlist 4. Fetch playlist using i.e. `playlist_items_manual()` **Expected behavior** The playlist should have items typed as `PlayableItem::Track` and `PlayableItem::Episode` **Log/Output data** Here's one of the items that should have been a podcast episode but was typed as a track instead: ``` Track(FullTrack { album: SimplifiedAlbum { album_group: None, album_type: Some("compilation"), artists: [SimplifiedArtist { external_urls: {"spotify": "https://open.spotify.com/show/2Shpxw7dPoxRJCdfFXTWLE"}, href: Some("https://api.spotify.com/v1/shows/2Shpxw7dPoxRJCdfFXTWLE"), id: Some(ArtistId("2Shpxw7dPoxRJCdfFXTWLE")), name: "Philosophize This!" }], available_markets: ["AD", "AE", "AG", "AL", "AM", "AO", "AR", "AT", "AU", "AZ", "BA", "BB", "BE", "BF", "BG", "BH", "BI", "BJ", "BN", "BO", "BR", "BS", "BT", "BW", "BZ", "CA", "CH", "CI", "CL", "CM", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "ES", "FI", "FJ", "FM", "FR", "GA", "GB", "GD", "GE", "GH", "GM", "GN", "GQ", "GR", "GT", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IS", "IT", "JM", "JO", "JP", "KE", "KH", "KI", "KM", "KN", "KW", "LA", "LB", "LC", "LI", "LR", "LS", "LT", "LU", "LV", "MA", "MC", "ME", "MG", "MH", "MK", "ML", "MN", "MO", "MR", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NZ", "OM", "PA", "PE", "PG", "PH", "PL", "PS", "PT", "PW", "PY", "QA", "RO", "RS", "RW", "SA", "SB", "SC", "SE", "SG", "SI", "SK", "SL", "SM", "SN", "SR", "ST", "SV", "SZ", "TD", "TG", "TH", "TL", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "US", "UY", "UZ", "VC", "VN", "VU", "WS", "XK", "ZA", "ZM", "ZW"], external_urls: {"spotify": "https://open.spotify.com/show/2Shpxw7dPoxRJCdfFXTWLE"}, href: Some("https://api.spotify.com/v1/shows/2Shpxw7dPoxRJCdfFXTWLE"), id: Some(AlbumId("2Shpxw7dPoxRJCdfFXTWLE")), images: [Image { height: Some(640), url: "https://i.scdn.co/image/f07f5f6476583502fac99edd5eb83e99dfaf4633", width: Some(640) }, Image { height: Some(300), url: "https://i.scdn.co/image/b01d89d740d3275d16082b5c5e597b12881bec26", width: Some(300) }, Image { height: Some(64), url: "https://i.scdn.co/image/7c2c22f4fe4d0193c886b297920626c136fccde0", width: Some(64) }], name: "Philosophize This!", release_date: None, release_date_precision: None, restrictions: Some(Restriction { reason: Product }) }, artists: [SimplifiedArtist { external_urls: {"spotify": "https://open.spotify.com/show/2Shpxw7dPoxRJCdfFXTWLE"}, href: Some("https://api.spotify.com/v1/shows/2Shpxw7dPoxRJCdfFXTWLE"), id: Some(ArtistId("2Shpxw7dPoxRJCdfFXTWLE")), name: "Philosophize This!" }], available_markets: ["AD", "AE", "AG", "AL", "AM", "AO", "AR", "AT", "AU", "AZ", "BA", "BB", "BE", "BF", "BG", "BH", "BI", "BJ", "BN", "BO", "BR", "BS", "BT", "BW", "BZ", "CA", "CH", "CI", "CL", "CM", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "ES", "FI", "FJ", "FM", "FR", "GA", "GB", "GD", "GE", "GH", "GM", "GN", "GQ", "GR", "GT", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IS", "IT", "JM", "JO", "JP", "KE", "KH", "KI", "KM", "KN", "KW", "LA", "LB", "LC", "LI", "LR", "LS", "LT", "LU", "LV", "MA", "MC", "ME", "MG", "MH", "MK", "ML", "MN", "MO", "MR", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NZ", "OM", "PA", "PE", "PG", "PH", "PL", "PS", "PT", "PW", "PY", "QA", "RO", "RS", "RW", "SA", "SB", "SC", "SE", "SG", "SI", "SK", "SL", "SM", "SN", "SR", "ST", "SV", "SZ", "TD", "TG", "TH", "TL", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "US", "UY", "UZ", "VC", "VN", "VU", "WS", "XK", "ZA", "ZM", "ZW"], disc_number: 0, duration: 1675.68s, explicit: false, external_ids: {"spotify": "https://open.spotify.com/episode/3eCVbzwX4rZvwmcrGwmhHs"}, external_urls: {"spotify": "https://open.spotify.com/episode/3eCVbzwX4rZvwmcrGwmhHs"}, href: Some("https://api.spotify.com/v1/episodes/3eCVbzwX4rZvwmcrGwmhHs"), id: Some(TrackId("3eCVbzwX4rZvwmcrGwmhHs")), is_local: false, is_playable: Some(false), linked_from: None, restrictions: None, name: "Episode #165 ... Ralph Waldo Emerson - Nature and Other Things", popularity: 0, preview_url: Some("https://p.scdn.co/mp3-preview/f20fa210a955025247b33d5087fba650d5b046b9"), track_number: 0 }) ``` Note the URIs pointing to a show object.
kerem 2026-02-27 20:23:07 +03:00
Author
Owner

@ramsayleung commented on GitHub (Jun 2, 2022):

Hi Henrik, thanks for your report, would you like to post your code to reproduce this problem?

  1. Create a new playlist
  2. Add music track to playlist
  3. Add podcast episode to playlist
  4. Fetch playlist using i.e. playlist_items_manual()
<!-- gh-comment-id:1144333681 --> @ramsayleung commented on GitHub (Jun 2, 2022): Hi Henrik, thanks for your report, would you like to post your code to reproduce this problem? > 1. Create a new playlist > 2. Add music track to playlist > 3. Add podcast episode to playlist > 4. Fetch playlist using i.e. playlist_items_manual()
Author
Owner

@hrkfdn commented on GitHub (Jun 2, 2022):

Hey @ramsayleung, I would, but there really isn't much to it. Steps 1-3 I did using the Spotify desktop app, and then in step 4 I just fetched the playlist.

<!-- gh-comment-id:1145220682 --> @hrkfdn commented on GitHub (Jun 2, 2022): Hey @ramsayleung, I would, but there really isn't much to it. Steps 1-3 I did using the Spotify desktop app, and then in step 4 I just fetched the playlist.
Author
Owner

@ramsayleung commented on GitHub (Jun 3, 2022):

Oooh, I can reproduce this problem.

items that should have been a podcast episode but was typed as a track instead

But I think Spotify explicitly treats the podcast episode as track instead of Rspotify doing so. You could confirm this with Spotify Web Console: https://developer.spotify.com/console/get-playlist-tracks/

<!-- gh-comment-id:1145925240 --> @ramsayleung commented on GitHub (Jun 3, 2022): Oooh, I can reproduce this problem. > items that should have been a podcast episode but was typed as a track instead But I think Spotify explicitly treats the podcast `episode` as `track` instead of `Rspotify` doing so. You could confirm this with Spotify Web Console: https://developer.spotify.com/console/get-playlist-tracks/
Author
Owner

@hrkfdn commented on GitHub (Jun 21, 2022):

Hey there, thanks for looking into this. Oh that's a shame. How could this be handled? Type it as a PlayableItem::Episode in rspotify based on the URI?

<!-- gh-comment-id:1162176850 --> @hrkfdn commented on GitHub (Jun 21, 2022): Hey there, thanks for looking into this. Oh that's a shame. How could this be handled? Type it as a `PlayableItem::Episode` in rspotify based on the URI?
Author
Owner

@ramsayleung commented on GitHub (Jun 22, 2022):

I think it's the inconsistency introduced by Spotify Web API should not be handled by RSpotify unless Spotify explicitly points out the rule that we should deduce the type of PlayableItem by URI instead of Type.

There is another bad case, the Type is correct (we could say Episode), but the URI is incorrect(track URI).

<!-- gh-comment-id:1163111884 --> @ramsayleung commented on GitHub (Jun 22, 2022): I think it's the inconsistency introduced by Spotify Web API should not be handled by `RSpotify` unless Spotify explicitly points out the rule that we should deduce the type of `PlayableItem` by URI instead of Type. There is another bad case, the Type is correct (we could say `Episode`), but the URI is incorrect(`track` URI).
Author
Owner

@github-actions[bot] commented on GitHub (Jun 26, 2023):

Message to comment on stale issues. If none provided, will not mark issues stale

<!-- gh-comment-id:1606513441 --> @github-actions[bot] commented on GitHub (Jun 26, 2023): Message to comment on stale issues. If none provided, will not mark issues stale
Author
Owner

@github-actions[bot] commented on GitHub (Nov 28, 2025):

Message to comment on stale issues. If none provided, will not mark issues stale

<!-- gh-comment-id:3587752703 --> @github-actions[bot] commented on GitHub (Nov 28, 2025): Message to comment on stale issues. If none provided, will not mark issues stale
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#100
No description provided.