Skip to content

Commit de61db9

Browse files
committed
fix: B50 计算与展示排除宴会场(Utage)曲目
1 parent c711a95 commit de61db9

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

database/routes/maimaidx/records.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,11 @@ export async function getB50({
326326
const newScores: ScoreResponse[] = [];
327327

328328
for (const score of scores) {
329+
// 排除宴会场曲目
330+
if (score.chart.type === "utage" || score.chart.difficulty === "utage") {
331+
continue;
332+
}
333+
329334
const scoreResponse: ScoreResponse = {
330335
id: score.chart.music.id,
331336
title: score.chart.music.title,

database/routes/maimaidx/utils/rating.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ export async function calculateUserB50Rating(
8383
const newScores: number[] = [];
8484

8585
for (const score of scores) {
86+
// 排除宴会场曲目
87+
if (score.chart.type === "utage" || score.chart.difficulty === "utage") {
88+
continue;
89+
}
90+
8691
if (score.chart.versions.includes(latestVersion.id)) {
8792
newScores.push(score.rating);
8893
} else {

src/pages/b50.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import { dialog, snackbar } from "mdui";
1515
import { markDialogOpen, markDialogClosed } from "@/components/app/router";
1616
import { ScoreCoefficient } from "@/components/data/chart/rating/ScoreCoefficient";
17+
import { isUtageGrade } from "@/components/data/chart/difficulty";
1718
1819
const route = useRoute();
1920
const shared = useShared();
@@ -72,7 +73,8 @@
7273
const records = getSourceRecords(useFitDiff);
7374
const charts = records
7475
.map(record => convertDFRecordToChart(record, useFitDiff))
75-
.filter((chart): chart is Chart => chart !== null);
76+
.filter((chart): chart is Chart => chart !== null)
77+
.filter(chart => !isUtageGrade(chart.info.grade));
7678
7779
const oldCharts = charts.filter(chart => chart.music.info.isNew === false);
7880
const newCharts = charts.filter(chart => chart.music.info.isNew === true);

0 commit comments

Comments
 (0)