fix: strip null synth_engine from project JSON

- Frontend serialize: use undefined instead of null for synth_engine
- Backend validate: strip None synth_engine from tracks before schema validation
- Prevents 'None is not of type object' schema error
This commit is contained in:
2026-07-26 18:22:35 +07:00
parent 7af0e61fb0
commit e843f55483
3 changed files with 11 additions and 3 deletions
+2 -2
View File
@@ -6137,7 +6137,7 @@ const serializeTracksList = (tracksList, secondsPerBar) => {
soundfont_id: t.soundfont_id || (t.synth_engine ? t.synth_engine.soundfont_id : null),
soundfont_bank: t.soundfont_bank !== undefined ? t.soundfont_bank : (t.synth_engine ? t.synth_engine.soundfont_bank : null),
soundfont_program: t.soundfont_program !== undefined ? t.soundfont_program : (t.synth_engine ? t.synth_engine.soundfont_program : null),
synth_engine: t.synth_engine || null,
synth_engine: t.synth_engine || undefined,
items: items
};
});
@@ -6209,7 +6209,7 @@ const deserializeTracksList = (schemaTracks, secondsPerBar, sectionStore) => {
soundfont_id: t.soundfont_id || null,
soundfont_bank: t.soundfont_bank !== null ? t.soundfont_bank : undefined,
soundfont_program: t.soundfont_program !== null ? t.soundfont_program : undefined,
synth_engine: t.synth_engine || null
synth_engine: t.synth_engine || undefined
};
});
};