Edit package re-sync (#68) #125

Merged
crowmaki merged 2 commits from issue-68-edit-package-resync into main 2026-10-09 19:41:24 +00:00
Owner

Closes #68.

Re-exporting to an Edit package now syncs it in place, driven by the previous manifest.json:

  • Skip unchanged. A clip that is already in the package and comes from the same Rendition (same id and hash) is left alone. Edits the editor made to it survive, and Resolve's links keep working. A clip that is missing from the folder is written again.
  • Overwrite changed Renditions at the same path. This covers draft → final and re-promotion. The new file goes to <file>.partial and is then renamed over the old one, so a hard-linked master is unlinked and linked again.
  • Rewrite timelines and metadata. Timelines, .srt files, takes.csv and manifest.json are rewritten on every export.
  • Set aside what dropped out. Files the last export wrote and this one doesn't are moved to _Removed/<local date>/ at the same relative path. That covers clips of NG Takes, uncircled clips under Circled only, and clips of Scenes left out. When the same name was already set aside that day, the new copy is numbered name (2).ext. Nothing is deleted. Only now-empty folders are removed.
  • The manifest is now version 2. It adds a files list of the Animatic stills, Performance WAVs and timelines, so these are set aside too when a Scene drops out. A version 1 manifest has no such list, so only its clips are synced.
  • Refusals. Export refuses, writing nothing, a folder whose manifest.json can't be read or belongs to another Project.
  • UI. The Export view warns before Circled only is switched on. Cancel or Escape turns the box off again. After an export, the view reports how many clips were unchanged and how many files were set aside.

Two judgement calls go beyond the ticket's wording: non-clip files are set aside too, and another Project's package is refused. Both follow from "a Project exports to one Edit package … nothing is deleted".

Deleted Takes: only failed Takes can be deleted today, and they never have a clip, so that case can't come up yet. The same set difference would handle it.

Screenshots

Circled only warning

Re-export result after leaving Scene 2 out

Tests

  • cargo test --workspace --all-features: 827 passed
  • bun test src scripts: 255 passed
  • bun run check: clean

New tests are in crates/studio-core/tests/edit_package.rs:

  • skip unchanged clips and overwrite a promoted one at the same path
  • add a new Take
  • write again a clip missing from the folder
  • set aside an NG Take
  • set aside uncircled clips under Circled only
  • set aside a Scene that was left out, with its timelines
  • keep both copies when a file is set aside twice in a day
  • refuse another Project's package and an unreadable manifest
Closes #68. Re-exporting to an Edit package now syncs it in place, driven by the previous `manifest.json`: - **Skip unchanged.** A clip that is already in the package and comes from the same Rendition (same id and hash) is left alone. Edits the editor made to it survive, and Resolve's links keep working. A clip that is missing from the folder is written again. - **Overwrite changed Renditions** at the same path. This covers draft → final and re-promotion. The new file goes to `<file>.partial` and is then renamed over the old one, so a hard-linked master is unlinked and linked again. - **Rewrite timelines and metadata.** Timelines, `.srt` files, `takes.csv` and `manifest.json` are rewritten on every export. - **Set aside what dropped out.** Files the last export wrote and this one doesn't are moved to `_Removed/<local date>/` at the same relative path. That covers clips of NG Takes, uncircled clips under Circled only, and clips of Scenes left out. When the same name was already set aside that day, the new copy is numbered `name (2).ext`. Nothing is deleted. Only now-empty folders are removed. - The manifest is now **version 2**. It adds a `files` list of the Animatic stills, Performance WAVs and timelines, so these are set aside too when a Scene drops out. A version 1 manifest has no such list, so only its clips are synced. - **Refusals.** Export refuses, writing nothing, a folder whose `manifest.json` can't be read or belongs to another Project. - **UI.** The Export view warns before Circled only is switched on. Cancel or Escape turns the box off again. After an export, the view reports how many clips were unchanged and how many files were set aside. Two judgement calls go beyond the ticket's wording: non-clip files are set aside too, and another Project's package is refused. Both follow from "a Project exports to one Edit package … nothing is deleted". Deleted Takes: only failed Takes can be deleted today, and they never have a clip, so that case can't come up yet. The same set difference would handle it. ## Screenshots ![Circled only warning](https://git.crowmaki.me/attachments/462a6a50-01f5-496b-9044-777d61443d67) ![Re-export result after leaving Scene 2 out](https://git.crowmaki.me/attachments/02fbc3a3-6ead-4db5-9371-a42f4ce3b7c9) ## Tests - `cargo test --workspace --all-features`: 827 passed - `bun test src scripts`: 255 passed - `bun run check`: clean New tests are in `crates/studio-core/tests/edit_package.rs`: - skip unchanged clips and overwrite a promoted one at the same path - add a new Take - write again a clip missing from the folder - set aside an NG Take - set aside uncircled clips under Circled only - set aside a Scene that was left out, with its timelines - keep both copies when a file is set aside twice in a day - refuse another Project's package and an unreadable manifest
Re-export is driven by the previous manifest.json: clips from the same
Rendition are skipped, changed ones are replaced at the same path, and
files the export no longer writes move to _Removed/<date>/. The manifest
now lists the package's other files (version 2). A folder holding another
Project's package, or an unreadable manifest, is refused. The Export view
warns before switching Circled only on and reports what the sync did.
Name the outcome's count set_aside, as CONTEXT.md does, and date the
_Removed folder by the local date. Match kept paths without regard to
case, so a bin renamed only in case doesn't set aside its new clips.
Pull the set-aside step out of write, test a new Take between exports,
and word the UI as files set aside.
crowmaki deleted branch issue-68-edit-package-resync 2026-10-09 19:41:24 +00:00
Sign in to join this conversation.
No description provided.