fix: fetch unlocalized player data to interpret errors correctly; regression introduced with v0.6.0

This commit is contained in:
ThetaDev 2024-11-09 03:00:04 +01:00
parent 044094a4b7
commit 0919cbd0df
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
5 changed files with 22 additions and 12 deletions

View file

@ -1820,7 +1820,7 @@ impl RustyPipeQuery {
id: &str,
endpoint: &str,
body: &B,
ctx_src: MapRespCtxSource<'_>,
ctx_src: MapRespOptions<'_>,
) -> Result<M, Error> {
tracing::debug!("getting {}({})", operation, id);
@ -1946,7 +1946,7 @@ impl RustyPipeQuery {
id,
endpoint,
body,
MapRespCtxSource::default(),
MapRespOptions::default(),
)
.await
}
@ -1989,6 +1989,7 @@ impl AsRef<RustyPipeQuery> for RustyPipeQuery {
}
}
/// Additional data needed for mapping YouTube responses
struct MapRespCtx<'a> {
id: &'a str,
lang: Language,
@ -1998,8 +1999,10 @@ struct MapRespCtx<'a> {
artist: Option<ArtistId>,
}
/// Options to give to the mapper when making requests;
/// used to construct the [`MapRespCtx`]
#[derive(Default)]
struct MapRespCtxSource<'a> {
struct MapRespOptions<'a> {
visitor_data: Option<&'a str>,
deobf: Option<&'a DeobfData>,
artist: Option<ArtistId>,