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

Fetched playlist contains Track items for episodes #320

Open
hrkfdn opened this issue May 28, 2022 · 6 comments
Open

Fetched playlist contains Track items for episodes #320

hrkfdn opened this issue May 28, 2022 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@hrkfdn
Copy link
Contributor

hrkfdn commented May 28, 2022

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.

@hrkfdn hrkfdn added bug Something isn't working help wanted Extra attention is needed labels May 28, 2022
@ramsayleung
Copy link
Owner

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()

@hrkfdn
Copy link
Contributor Author

hrkfdn commented 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.

@ramsayleung
Copy link
Owner

ramsayleung commented 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/

@hrkfdn
Copy link
Contributor Author

hrkfdn commented 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?

@ramsayleung
Copy link
Owner

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).

@github-actions
Copy link

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

@github-actions github-actions bot added the Stale label Jun 26, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2023
@ramsayleung ramsayleung removed the Stale label Dec 8, 2023
@ramsayleung ramsayleung reopened this Dec 8, 2023
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