perf: drop json output support
This commit is contained in:
@@ -363,9 +363,48 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
|
||||
}
|
||||
#[cfg(feature = "fetchall")]
|
||||
Commands::ScrapeAllB50Dump {} => {
|
||||
use crate::{cache::B50, utils::helpers::dump_json};
|
||||
use sdgb_api::title::model::{MusicRating, MusicRatingFlatten};
|
||||
|
||||
dump_json::<GetUserRatingApiResp>("b50.json", B50)?;
|
||||
use crate::{
|
||||
cache::B50,
|
||||
utils::helpers::{dump_parquet, read_cache},
|
||||
};
|
||||
|
||||
let records: Vec<GetUserRatingApiResp> = read_cache(B50)?;
|
||||
dump_parquet::<MusicRatingFlatten>(
|
||||
records
|
||||
.into_iter()
|
||||
.map(
|
||||
|GetUserRatingApiResp {
|
||||
user_id,
|
||||
user_rating,
|
||||
}| {
|
||||
user_rating
|
||||
.rating_list
|
||||
.into_iter()
|
||||
.chain(user_rating.next_rating_list)
|
||||
.map(
|
||||
move |MusicRating {
|
||||
music_id,
|
||||
level,
|
||||
rom_version,
|
||||
achievement,
|
||||
}| {
|
||||
MusicRatingFlatten {
|
||||
user_id,
|
||||
music_id,
|
||||
level,
|
||||
rom_version,
|
||||
achievement,
|
||||
}
|
||||
},
|
||||
)
|
||||
},
|
||||
)
|
||||
.flatten()
|
||||
.collect::<Vec<_>>(),
|
||||
"b50.parquet",
|
||||
)?;
|
||||
}
|
||||
|
||||
Commands::Userdata {
|
||||
|
||||
Reference in New Issue
Block a user