Skip to content

Commit 7978685

Browse files
committed
chore: 优化定数冲突解决方法
1 parent 48270e2 commit 7978685

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

apps/tools/src/scratch.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import { Song } from '@clansty/maibot-types';
44
const result = new Set<number>();
55
for (const id of Object.keys(ALL_MUSIC)) {
66
const song = Song.fromId(Number(id));
7-
const chart = song.getChart('红', true);
8-
if (chart && chart.version === 'BUDDiES') {
9-
result.add(song.id % 1e4 + 1e4);
10-
}
117
}
128

139
console.log(Array.from(result));

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"dependencies": {
88
"@clansty/maibot-data": "workspace:^",
99
"@clansty/maibot-utils": "workspace:^",
10-
"@gekichumai/dxdata": "https://gitpkg.now.sh/gekichumai/dxrating/packages/dxdata?2be5e76ead90ab72ad10217618cabbedb0d227d8"
10+
"@gekichumai/dxdata": "https://gitpkg.now.sh/gekichumai/dxrating/packages/dxdata?46acbe693f0d5d95faa6732aaf13693e7b4737c3"
1111
}
1212
}

packages/types/src/Chart.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,25 @@ export default class Chart implements Sheet {
2626
const dataCopy = { ...data };
2727
delete dataCopy.level;
2828
Object.assign(this, dataCopy);
29+
const level140 = this.multiverInternalLevelValue?.BUDDiES;
30+
const level145 = this.multiverInternalLevelValue?.['BUDDiES PLUS'];
31+
if (level140 && ver === 140) {
32+
this.internalLevelValue = level140;
33+
}
34+
if (level145 && ver === 145) {
35+
this.internalLevelValue = level145;
36+
}
2937
const valueFromAllMusic = dataFromAllMusic?.notes[LEVEL_EN.indexOf(data.difficulty)]?.lv;
30-
if (valueFromAllMusic && this.internalLevelValue !== valueFromAllMusic) {
31-
false && console.log('发现了定数错误', dataFromAllMusic.name, data.type, data.difficulty, '来自 DXRating.net 的定数:', data.internalLevelValue, '来自 all-music.json 的定数:', valueFromAllMusic);
38+
if (this.regions && !Object.values(this.regions).some(Boolean)) {
39+
// 删除曲
3240
this.internalLevelValue = valueFromAllMusic;
3341
}
42+
if (valueFromAllMusic && this.internalLevelValue !== valueFromAllMusic) {
43+
this.internalLevelValue = Math.max(valueFromAllMusic, this.internalLevelValue);
44+
}
45+
// if (this.internalLevelValue !== valueFromAllMusic) {
46+
// console.log('发现了定数错误', dataFromAllMusic?.name, data.type, data.difficulty, '来自 DXRating.net 的定数:', data.internalLevelValue, '来自 all-music.json 的定数:', valueFromAllMusic);
47+
// }
3448
if (internalId && !this.internalId) {
3549
this.internalId = internalId;
3650
}

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)