fix: a/b test 8: parsing view count for tracks
This commit is contained in:
parent
93e5ad22e9
commit
22e298ff98
33 changed files with 389 additions and 260 deletions
|
|
@ -24,6 +24,7 @@ pub enum ABTest {
|
|||
TrendsPageHeaderRenderer = 5,
|
||||
DiscographyPage = 6,
|
||||
ShortDateFormat = 7,
|
||||
TrackViewcount = 8,
|
||||
PlaylistsForShorts = 9,
|
||||
}
|
||||
|
||||
|
|
@ -96,6 +97,7 @@ pub async fn run_test(
|
|||
ABTest::DiscographyPage => discography_page(&query).await,
|
||||
ABTest::ShortDateFormat => short_date_format(&query).await,
|
||||
ABTest::PlaylistsForShorts => playlists_for_shorts(&query).await,
|
||||
ABTest::TrackViewcount => track_viewcount(&query).await,
|
||||
}
|
||||
.unwrap();
|
||||
pb.inc(1);
|
||||
|
|
@ -246,6 +248,20 @@ pub async fn short_date_format(rp: &RustyPipeQuery) -> Result<bool> {
|
|||
}))
|
||||
}
|
||||
|
||||
pub async fn track_viewcount(rp: &RustyPipeQuery) -> Result<bool> {
|
||||
let res = rp.music_search("lieblingsmensch namika").await?;
|
||||
|
||||
let track = &res
|
||||
.tracks
|
||||
.iter()
|
||||
.find(|a| a.id == "6485PhOtHzY")
|
||||
.unwrap_or_else(|| {
|
||||
panic!("could not find track, got {:#?}", &res.tracks);
|
||||
});
|
||||
|
||||
Ok(track.view_count.is_some())
|
||||
}
|
||||
|
||||
pub async fn playlists_for_shorts(rp: &RustyPipeQuery) -> Result<bool> {
|
||||
let playlist = rp.playlist("UUSHh8gHdtzO2tXd593_bjErWg").await?;
|
||||
let v1 = playlist
|
||||
|
|
|
|||
Reference in a new issue