From 78edb10e15ddcd8c67e6807bd951e976c8c7b19d Mon Sep 17 00:00:00 2001 From: Marius Niveri Date: Fri, 17 Jan 2025 07:22:17 +0100 Subject: [PATCH] fix: Some shows not loading (#664) Co-authored-by: Thang Pham --- spotify_player/src/client/mod.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spotify_player/src/client/mod.rs b/spotify_player/src/client/mod.rs index 9bfbe192..4de8dd93 100644 --- a/spotify_player/src/client/mod.rs +++ b/spotify_player/src/client/mod.rs @@ -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> instead of Page + // 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(); @@ -1417,6 +1429,7 @@ impl Client { .all_paging_items(first_page, &Query::new()) .await? .into_iter() + .flatten() .map(std::convert::Into::into) .collect::>();