feat: scrape all player record

This commit is contained in:
mokurin000
2025-08-03 17:54:31 +08:00
parent 9a6e414793
commit 81c8f21729
5 changed files with 42 additions and 8 deletions

View File

@@ -231,6 +231,29 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
.await?;
}
#[cfg(feature = "fetchall")]
Commands::ScrapeAllRecord {
concurrency,
min_rating,
max_rating,
} => {
use crate::{
cache::{PLAYER_RECORD, PLAYERS},
utils::helpers::{cached_concurrent_fetch_userfn, read_cache},
};
let mut players: Vec<GetUserPreviewApiResp> = read_cache(PLAYERS)?;
players.retain(|p| p.player_rating >= min_rating && p.player_rating <= max_rating);
cached_concurrent_fetch_userfn(
players.iter().map(|p| p.user_id).collect::<Vec<u32>>(),
&client,
concurrency,
PLAYER_RECORD,
get_user_all_music,
)
.await?;
}
#[cfg(feature = "fetchall")]
Commands::ScrapeAllB50 {
concurrency,