ReadonlycaptionReadonlyclipsReadonlyclipReadonlykeyframesReadonlymediaReadonlyprojectsReadonlyservicesReadonlytracksReadonlytranscriptReadonlytranscriptReadonlytransformsReadonlytransitionsDeep-clone a project into a fresh, UNMARKED project (classic-editor surface): copies media (rows + OPFS files), tracks, clips, clip-transforms, keyframes, and transitions, remapping every foreign key. Orator transcript/caption rows are intentionally NOT copied — the clone is an editor project (captions are materialized as a text track by the caller). Returns the new project id.
Quota-guarded and self-rolling-back: estimates free OPFS space before starting
and, if any step throws partway, tears the half-built clone down via
deleteProject before rethrowing, so a failure never strands a zombie project
or orphaned bytes.
Cascade delete: remove a clip and all its transforms.
Delete a media asset and its OPFS file. Does NOT delete clips that reference this asset — caller must handle that.
Cascade delete: remove a project and EVERYTHING it ever stored — its rows at every level, and its whole media/proxy folder plus its export folder. Order: keyframes → clip transforms → transitions → clips → tracks → transcripts → caption config → media assets → project → files
Returns what went, counted here where the asset rows are already in hand so no caller has to read them back after they are gone.
Cascade delete: remove a track, its clips, their transforms, and the associated media assets + OPFS files.
Reclaim auxiliary video assets that nothing references any more (zero clips
point at them). Deletes each asset's row and OPFS file(s); returns the count
reclaimed. Scoped to auxiliary assets so it can NEVER delete user-imported
media — only edit-generated b-roll is eligible.
These orphans are produced by Orator's in-place video replace: the command
keeps its imported asset across undo (so a redo needn't re-copy the file),
which leaves the asset unreferenced if the edit is undone and abandoned. It
is therefore safe to call ONLY when no live undo history can still resurrect
such an asset — i.e. at project load, where the UndoManager starts empty.
Never call it mid-session.
Where this store's media files live; deleting a project or asset deletes them there.