feat: scrape all player record
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user