Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions bathbot/src/active/impls/relax/top.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ impl RelaxTopPagination {
};

let mods = &score.mods;
let max_attrs = Context::pp(map).mods(mods.clone()).performance().await;
let mut pp_manager = Context::pp(map).mods(mods.clone());
let max_attrs = pp_manager.performance().await;

// NOTE: Make generic versions of formatting functions later on
// this is ugly
Expand All @@ -141,7 +142,7 @@ impl RelaxTopPagination {
map_id = score.beatmap_id,
mods = ModsFormatter::new(mods),
pp = PpFormatter::new(score_pp, Some(max_pp)),
stars = score.beatmap.star_rating_normal,
stars = max_attrs.stars(),
acc = round(score.accuracy),
score = WithComma::new(score.total_score),
combo = ComboFormatter::new(score.combo, Some(max_combo)),
Expand Down Expand Up @@ -198,6 +199,4 @@ pub enum RelaxTopOrder {
Pp,
#[option(name = "Score", value = "score")]
Score,
#[option(name = "Stars", value = "stars")]
Stars,
}
5 changes: 0 additions & 5 deletions bathbot/src/commands/osu/relax/top.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ pub async fn top(orig: CommandOrigin<'_>, args: RelaxTop<'_>) -> Result<()> {
RelaxTopOrder::Score => {
scores.sort_unstable_by(|lhs, rhs| rhs.total_score.cmp(&lhs.total_score))
}
RelaxTopOrder::Stars => scores.sort_unstable_by(|lhs, rhs| {
rhs.beatmap
.star_rating_normal
.total_cmp(&lhs.beatmap.star_rating_normal)
}),
}

let pagination = RelaxTopPagination::builder()
Expand Down