mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-19 16:58:55 +00:00
Fix get_info_with not taking mods into account
This commit is contained in:
parent
abc0fc5f73
commit
68142c6236
1 changed files with 2 additions and 1 deletions
|
@ -41,12 +41,13 @@ impl BeatmapContent {
|
||||||
pub fn get_info_with(
|
pub fn get_info_with(
|
||||||
&self,
|
&self,
|
||||||
mode: Option<oppai_rs::Mode>,
|
mode: Option<oppai_rs::Mode>,
|
||||||
_mods: impl Into<oppai_rs::Mods>,
|
mods: impl Into<oppai_rs::Mods>,
|
||||||
) -> Result<BeatmapInfo> {
|
) -> Result<BeatmapInfo> {
|
||||||
let mut oppai = oppai_rs::Oppai::new_from_content(&self.content[..])?;
|
let mut oppai = oppai_rs::Oppai::new_from_content(&self.content[..])?;
|
||||||
if let Some(mode) = mode {
|
if let Some(mode) = mode {
|
||||||
oppai.mode(mode)?;
|
oppai.mode(mode)?;
|
||||||
}
|
}
|
||||||
|
oppai.mods(mods.into());
|
||||||
let objects = oppai.num_objects();
|
let objects = oppai.num_objects();
|
||||||
let stars = oppai.stars();
|
let stars = oppai.stars();
|
||||||
Ok(BeatmapInfo { stars, objects })
|
Ok(BeatmapInfo { stars, objects })
|
||||||
|
|
Loading…
Add table
Reference in a new issue