Skip to content

Commit

Permalink
fix: legacy score deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Nov 26, 2024
1 parent a5b966b commit 9bc787c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/model/score.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ use super::{
use crate::{error::OsuError, request::GetUser, Osu};

use rosu_mods::{serde::GameModsSeed, GameModIntermode, GameModsIntermode};
use serde::{de::DeserializeSeed, Deserialize, Deserializer};
use serde::{
de::{DeserializeSeed, IgnoredAny},
Deserialize, Deserializer,
};

use serde_json::value::RawValue;
use time::OffsetDateTime;
Expand Down Expand Up @@ -128,6 +131,8 @@ impl<'de> Deserialize<'de> for Score {
max_combo: u32,
passed: bool,
pp: Option<f32>,
#[serde(rename = "mode")]
_mode: Option<IgnoredAny>, // only available in legacy scores
#[serde(rename = "ruleset_id", alias = "mode_int")]
mode: GameMode,
#[serde(default, with = "serde_util::option_datetime")]
Expand Down

0 comments on commit 9bc787c

Please sign in to comment.