fix: A/B test 21: music album recommendations

This commit is contained in:
ThetaDev 2025-02-26 15:20:25 +01:00
parent 544782f8de
commit 6737512f5f
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
13 changed files with 8680 additions and 113 deletions

View file

@ -40,13 +40,11 @@ pub enum ABTest {
MusicPlaylistFacepile = 18,
MusicAlbumGroupsReordered = 19,
MusicContinuationItemRenderer = 20,
AlbumRecommends = 21,
}
/// List of active A/B tests that are run when none is manually specified
const TESTS_TO_RUN: &[ABTest] = &[
ABTest::MusicAlbumGroupsReordered,
ABTest::MusicContinuationItemRenderer,
];
const TESTS_TO_RUN: &[ABTest] = &[ABTest::MusicAlbumGroupsReordered, ABTest::AlbumRecommends];
#[derive(Debug, Serialize, Deserialize)]
pub struct ABTestRes {
@ -121,6 +119,7 @@ pub async fn run_test(
ABTest::MusicContinuationItemRenderer => {
music_continuation_item_renderer(&query).await
}
ABTest::AlbumRecommends => album_recommends(&query).await,
}
.unwrap();
pb.inc(1);
@ -443,3 +442,18 @@ pub async fn music_continuation_item_renderer(rp: &RustyPipeQuery) -> Result<boo
.await?;
Ok(res.contains("\"continuationItemRenderer\""))
}
pub async fn album_recommends(rp: &RustyPipeQuery) -> Result<bool> {
let id = "MPREb_u1I69lSAe5v";
let res = rp
.raw(
ClientType::DesktopMusic,
"browse",
&QBrowse {
browse_id: id,
params: None,
},
)
.await?;
Ok(res.contains("\"musicCarouselShelfRenderer\""))
}