fix: use same visitor data for fetching artist album continuations

This commit is contained in:
ThetaDev 2024-10-24 02:02:22 +02:00
parent 987d007cf1
commit 4b7db80afc

View file

@ -111,6 +111,7 @@ impl RustyPipeQuery {
&request_body, &request_body,
MapRespCtxSource { MapRespCtxSource {
artist: Some(first_page.artist.clone()), artist: Some(first_page.artist.clone()),
visitor_data: first_page.visitor_data.as_deref(),
..Default::default() ..Default::default()
}, },
) )
@ -319,6 +320,7 @@ struct FirstAlbumPage {
albums: Vec<AlbumItem>, albums: Vec<AlbumItem>,
ctoken: Option<String>, ctoken: Option<String>,
artist: ArtistId, artist: ArtistId,
visitor_data: Option<String>,
} }
impl MapResponse<FirstAlbumPage> for response::MusicArtistAlbums { impl MapResponse<FirstAlbumPage> for response::MusicArtistAlbums {
@ -372,6 +374,7 @@ impl MapResponse<FirstAlbumPage> for response::MusicArtistAlbums {
albums: mapped.c.albums, albums: mapped.c.albums,
ctoken, ctoken,
artist: artist_id, artist: artist_id,
visitor_data: ctx.visitor_data.map(str::to_owned),
}, },
warnings: mapped.warnings, warnings: mapped.warnings,
}) })