The open source AI video agent: turns any coding agent into a video agent, with an editor to change anything it makes.
Exports: an editing project's files named alike but for an accent's form are copied apart (#256)
riverisbuildingc0faee2ca234
diff --git a/.changeset/nle-accented-names.md b/.changeset/nle-accented-names.mdnew file mode 100644index 0000000..a0ec5f7--- /dev/null+++ b/.changeset/nle-accented-names.md@@ -0,0 +1,5 @@+---+"openfilm": patch+---++Exports: in an editing project (XML, FCPXML, 剪映 or CapCut draft), two files whose names differ only in how an accent is written (`café` in its two Unicode forms) each get a copy of their own, as two that differ only in case already did, so neither clip loses its footage on macOS.diff --git a/packages/openfilm/studio/server/exports.test.mjs b/packages/openfilm/studio/server/exports.test.mjsindex baf270a..82d42e5 100644--- a/packages/openfilm/studio/server/exports.test.mjs+++ b/packages/openfilm/studio/server/exports.test.mjs@@ -580,6 +580,19 @@ test('fades in the editor\'s timeline: a picture that fades is rendered; a soundassert.match(xmemlDocument(timeline), /<parameterid>level<\/parameterid>[\s\S]*<keyframe>\s*<when>0<\/when>\s*<value>0<\/value>\s*<\/keyframe>\s*<keyframe>\s*<when>13<\/when>/);});+test('an editing project\'s copied files get names of their own when two differ only in case or in how an accent is written', () => {+ const facts = { duration: 4, hasAudio: true, channels: 2, sampleRate: 48000 };+ const sound = (id, src, at) => ({ id, src, path: join(scratch, src), at, from: 0, to: 2, speed: 1, volume: 1, enabled: true, role: 'voice', facts });+ const nfc = 'caf\u00e9', nfd = 'cafe\u0301';+ const timeline = planNleTimeline({ stage: { w: 320, h: 180 }, duration: 6, pictures: [], sounds: [+ sound('a', `assets/a/${nfc}.wav`, 0), sound('b', `assets/b/${nfd}.wav`, 2), sound('c', `assets/c/CAF\u00c9.wav`, 4),+ ] }, { title: 'Names', fps: 25, audio: 'clips', media: 'copy', mediaDir: '/out/media' });+ const names = timeline.files.map((f) => f.name);+ assert.equal(names.length, 3);+ assert.equal(new Set(names.map((n) => n.toLowerCase().normalize('NFC'))).size, 3, names.join(', '));+ assert.deepEqual(timeline.files.map((f) => f.job.from), ['a', 'b', 'c'].map((d, i) => join(scratch, `assets/${d}/${[nfc, nfd, 'CAF\u00c9'][i]}.wav`)));+});+test('Final Cut Pro keeps source audio rows when an effect overlaps adjacent narration clips', () => {const facts = { duration: 120, hasAudio: true, channels: 2, sampleRate: 48000 };const sound = (id, track, at, to) => ({ id, track, at, from: 0, to, speed: 1, volume: 1, enabled: true,diff --git a/packages/openfilm/studio/server/nle.mjs b/packages/openfilm/studio/server/nle.mjsindex 860946d..92cc2d1 100644--- a/packages/openfilm/studio/server/nle.mjs+++ b/packages/openfilm/studio/server/nle.mjs@@ -182,10 +182,13 @@ export function planNleTimeline(film, opts) {let fileSeq = 0, clipSeq = 0;const total = Math.max(1, toFrame(film.duration, rate));+ /* one name to a disk that takes upper and lower case, or a letter written whole or as letter and accent (macOS:+ `café` NFC and NFD), as the same: two such files would be one */+ const sameOnDisk = (/** @type {string} */ name) => name.toLowerCase().normalize('NFC');const mediaPath = (/** @type {string} */ stem, /** @type {string} */ ext) => {let name = `${safeStem(stem)}.${ext}`;- for (let n = 2; names.has(name.toLowerCase()); n++) name = `${safeStem(stem)} (${n}).${ext}`;- names.add(name.toLowerCase());+ for (let n = 2; names.has(sameOnDisk(name)); n++) name = `${safeStem(stem)} (${n}).${ext}`;+ names.add(sameOnDisk(name));/* the system's own separators: a draft on Windows names its files with backslashes, as 剪映 does */return { name, path: join(opts.mediaDir, name) };};