Skip to content

Commit ba4e804

Browse files
BentroenCopilot
andauthored
fix(song): constrain defaultInstrumentCount to 16 or 20
We currently implicitly expect all songs on the website to have been generated with Note Block Studio, which will save songs with either 16 or 20 default instruments since the first NBS format upgrade. If a custom-generated song is uploaded that contains fewer instruments, the song normalization should coerce it to have one of these instrument counts. The database allowed any integer to be in this field, though, which is fine. However, in the case this coercion process fails, we would like an extra safeguard so it fails 'early' before the suspicious document is persisted to the database. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent ea01553 commit ba4e804

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/database/src/song/dto/SongStats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export class SongStats {
5656
nbsVersion: number;
5757

5858
@IsInt()
59+
@IsIn([16, 20])
5960
defaultInstrumentCount: number;
60-
6161
@IsInt()
6262
outOfRangeNoteCount: number;
6363

0 commit comments

Comments
 (0)