Skip to content

Commit

Permalink
fix: Some shows not loading (#664)
Browse files Browse the repository at this point in the history
Co-authored-by: Thang Pham <[email protected]>
  • Loading branch information
m4r1vs and aome510 authored Jan 17, 2025
1 parent 16491d5 commit 78edb10
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spotify_player/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,18 @@ impl Client {
let show = self.get_a_show(show_id, None).await?;
let first_page = show.episodes.clone();

// Copy first_page but use Page<Option<SimplifiedEpisode>> instead of Page<SimplifiedEpisode>
// This is a temporary fix for https://github.com/aome510/spotify-player/issues/663
let first_page = rspotify::model::Page {
items: first_page.items.into_iter().map(Some).collect(),
href: first_page.href,
limit: first_page.limit,
next: first_page.next,
offset: first_page.offset,
previous: first_page.previous,
total: first_page.total,
};

// converts `rspotify::model::FullShow` into `state::Show`
let show: Show = show.into();

Expand All @@ -1417,6 +1429,7 @@ impl Client {
.all_paging_items(first_page, &Query::new())
.await?
.into_iter()
.flatten()
.map(std::convert::Into::into)
.collect::<Vec<_>>();

Expand Down

0 comments on commit 78edb10

Please sign in to comment.