Skip to content

Commit f09f3d9

Browse files
committed
Prune unnecessary issues for short songs
1 parent f71e63a commit f09f3d9

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.changeset/nervous-apples-sneeze.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"scan-chart": patch
3+
---
4+
5+
Prune unnecessary issues for short songs

src/chart/chart-scanner.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ function findChartIssues(
234234
} else {
235235
const expertHash = trackHashes.find(t => t.instrument === instrumentGroup[0].instrument && t.difficulty === 'expert')!.hash
236236
for (const track of instrumentGroup.filter(t => t.difficulty !== 'expert')) {
237-
if (expertHash === trackHashes.find(t => t.instrument === track.instrument && t.difficulty === track.difficulty)!.hash) {
237+
if (
238+
expertHash === trackHashes.find(t => t.instrument === track.instrument && t.difficulty === track.difficulty)!.hash &&
239+
track.noteEventGroups.length > 20
240+
) {
238241
addIssue(track.instrument, track.difficulty, 'difficultyNotReduced')
239242
}
240243
}
@@ -294,7 +297,11 @@ function findChartIssues(
294297

295298
// noStarPower
296299
{
297-
if (track.starPowerSections.length === 0) {
300+
if (
301+
track.starPowerSections.length === 0 &&
302+
track.noteEventGroups.length > 50 &&
303+
_.last(track.noteEventGroups)![0].msTime - _.first(track.noteEventGroups)![0].msTime > 60000
304+
) {
298305
addIssue('noStarPower')
299306
}
300307
}
@@ -324,7 +331,12 @@ function findChartIssues(
324331

325332
// noDrumActivationLanes
326333
{
327-
if (track.instrument === 'drums' && track.drumFreestyleSections.length === 0) {
334+
if (
335+
track.instrument === 'drums' &&
336+
track.drumFreestyleSections.length === 0 &&
337+
track.noteEventGroups.length > 50 &&
338+
_.last(track.noteEventGroups)![0].msTime - _.first(track.noteEventGroups)![0].msTime > 60000
339+
) {
328340
addIssue('noDrumActivationLanes')
329341
}
330342
}

0 commit comments

Comments
 (0)