chore: update to Maimai DX Circle

This commit is contained in:
2025-09-25 00:11:28 +08:00
parent 672f82bd85
commit 9e628dca63
8 changed files with 2243 additions and 334 deletions

View File

@@ -11,10 +11,17 @@ default = ["compio", "fetchall"]
compio = ["dep:compio", "sdgb-api/compio"]
tokio = ["dep:tokio", "sdgb-api/tokio"]
fetchall = ["dep:redb", "dep:futures-util", "dep:parquet", "sdgb-api/parquet"]
fetchall = [
"dep:redb",
"dep:futures-util",
"dep:parquet",
"dep:music-db",
"sdgb-api/parquet",
]
[dependencies]
sdgb-api = { workspace = true, features = ["bincode"] }
music-db = { workspace = true, optional = true }
# (de)serialization
serde = { workspace = true }
@@ -35,7 +42,7 @@ compio = { workspace = true, features = ["macros"], optional = true }
nyquest-preset = { version = "0.3.0", features = ["async"] }
palc = { version = "0.0.1", features = ["derive"] }
palc = { version = "0.0.2" }
futures-util = { version = "0.3.31", optional = true }
ctrlc = { version = "3.4.7", features = ["termination"] }

View File

@@ -3,7 +3,7 @@ use palc::Subcommand;
use strum::EnumString;
#[derive(Parser)]
#[command(about = "SDGB api tool", long_about = env!("CARGO_PKG_DESCRIPTION"))]
#[command(long_about = env!("CARGO_PKG_DESCRIPTION"))]
pub struct Cli {
/// Try to generate machine readable format.
///
@@ -139,7 +139,7 @@ pub enum Commands {
},
}
#[derive(Debug, Default, EnumString)]
#[derive(Debug, Default, EnumString, strum::Display)]
#[strum(serialize_all = "snake_case")]
pub enum RatingFormat {
#[default]

View File

@@ -383,20 +383,24 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
.rating_list
.into_iter()
.chain(user_rating.next_rating_list)
.map(
.filter_map(
move |MusicRating {
music_id,
level,
rom_version,
achievement,
}| {
MusicRatingFlatten {
let (_rank, dx_rating) =
music_db::query_music_level(music_id, level)?
.dx_rating(achievement);
Some(MusicRatingFlatten {
user_id,
music_id,
level,
rom_version,
achievement,
}
dx_rating,
})
},
)
},