fix(audio): recover clip serverFileId from audio_file_url on project load

3 fixes for audio clips losing sound after save/reload:
1. deserializeTracksList: clip-level serverFileId falls back
   to extracting from audio_file_url when server_file_id missing
2. serializeTracksList: add server_file_id to track output
   so track-level fallback survives round-trip
3. upgrade_project_json_if_needed: include server_file_id
   in source_data during legacy project upgrade
This commit is contained in:
2026-07-30 22:26:53 +07:00
parent 0894f97386
commit be3205645f
3 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -7634,6 +7634,7 @@ const serializeTracksList = (tracksList, secondsPerBar) => {
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 || undefined,
server_file_id: t.serverFileId || null,
items: items
};
});
@@ -7648,7 +7649,7 @@ const deserializeTracksList = (schemaTracks, secondsPerBar, sectionStore) => {
(t.items || []).forEach(item => {
if (item.type === "AUDIO_ITEM") {
const src = item.source_data || {};
const clipFileId = src.server_file_id || null;
const clipFileId = src.server_file_id || (src.audio_file_url ? src.audio_file_url.split('/').pop() : null) || null;
clips.push({
id: item.id,
name: item.name,
File diff suppressed because one or more lines are too long