feat: dump fetched b50
This commit is contained in:
@@ -96,6 +96,8 @@ pub enum Commands {
|
||||
},
|
||||
#[cfg(feature = "fetchall")]
|
||||
ListAllUserDump {},
|
||||
#[cfg(feature = "fetchall")]
|
||||
ScrapeAllB50Dump {},
|
||||
|
||||
Logout {
|
||||
#[arg(short, long)]
|
||||
|
||||
@@ -255,12 +255,6 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
|
||||
cached_concurrent_fetch::<GetUserPreviewApi>(user_ids, &client, concurrency, PLAYERS)
|
||||
.await?;
|
||||
}
|
||||
#[cfg(feature = "fetchall")]
|
||||
Commands::ListAllUserDump {} => {
|
||||
use crate::{cache::PLAYERS, utils::helpers::dump_cache};
|
||||
|
||||
dump_cache::<GetUserPreviewApiResp>("players.json", PLAYERS)?;
|
||||
}
|
||||
|
||||
#[cfg(feature = "fetchall")]
|
||||
Commands::ScrapeAllB50 {
|
||||
@@ -287,6 +281,19 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
|
||||
.await?;
|
||||
}
|
||||
|
||||
#[cfg(feature = "fetchall")]
|
||||
Commands::ListAllUserDump {} => {
|
||||
use crate::{cache::PLAYERS, utils::helpers::dump_cache};
|
||||
|
||||
dump_cache::<GetUserPreviewApiResp>("players.json", PLAYERS)?;
|
||||
}
|
||||
#[cfg(feature = "fetchall")]
|
||||
Commands::ScrapeAllB50Dump {} => {
|
||||
use crate::{cache::PLAYER_B50, utils::helpers::dump_cache};
|
||||
|
||||
dump_cache::<GetUserRatingApiResp>("b50.json", PLAYER_B50)?;
|
||||
}
|
||||
|
||||
Commands::Userdata { user_id } => {
|
||||
let action = async |_| match Sdgb1_50::request::<_, GetUserDataApiResp>(
|
||||
&client,
|
||||
|
||||
@@ -20,6 +20,7 @@ use bincode::{BorrowDecode, Encode, borrow_decode_from_slice};
|
||||
|
||||
use crate::{EARLY_QUIT, cache};
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn read_cache_keys(
|
||||
definition: TableDefinition<'_, u32, Vec<u8>>,
|
||||
) -> Result<Vec<u32>, Box<dyn snafu::Error>> {
|
||||
|
||||
Reference in New Issue
Block a user