Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

fix: add UpdateMediaPath command and fix ModelRc wrapper

Domica8d4ab3f7e6e3
diff --git a/engine/crates/concat-project/src/commands.rs b/engine/crates/concat-project/src/commands.rs
index 6fe73bf6..b5dc3245 100644
--- a/engine/crates/concat-project/src/commands.rs
+++ b/engine/crates/concat-project/src/commands.rs
@@ -599,6 +599,13 @@ pub enum Command {
/// The family to unregister.
family: String,
},
+ /// Updates a media item's path on disk (relink). An unknown id is a no-op.
+ UpdateMediaPath {
+ /// The media item to update.
+ media_id: String,
+ /// The new absolute path on disk.
+ new_path: String,
+ },
}
/// What a command produced, beyond the new state: the ids it minted, so the
@@ -2111,5 +2118,17 @@ pub fn apply(
applied,
})
}
+
+ Command::UpdateMediaPath { media_id, new_path } => {
+ let applied = project
+ .media
+ .iter_mut()
+ .find(|item| item.id == media_id)
+ .is_some_and(|item| assign(&mut item.path, new_path));
+ Ok(Outcome {
+ created_id: None,
+ applied,
+ })
+ }
}
}