mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-31 05:27:08 -06:00
engine: treat null sequence options as unspecified in Replace Footage
This commit is contained in:
@@ -885,7 +885,7 @@ fn replace_footage(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
_ => (false, false, false),
|
||||
};
|
||||
let mut opts = SequenceOptions::from_params(p);
|
||||
if p.get("sequence").is_none() && p.get("alphabetical").is_none() {
|
||||
if b_p(p, "sequence").is_none() && b_p(p, "alphabetical").is_none() {
|
||||
(opts.sequence, opts.folders, opts.alphabetical) = previous;
|
||||
}
|
||||
let src = crate::sequence::source_of(s.services.as_ref(), &path, opts);
|
||||
|
||||
@@ -190,6 +190,10 @@ fn replace_footage_keeps_a_still_a_still() {
|
||||
s.execute("file.replaceFootage", json!({"path": at(&dir, "shot_0004.png")})).unwrap();
|
||||
let (name, f) = footage(&s, &item);
|
||||
assert_eq!((name.as_str(), f.kind), ("shot_0004.png", FootageKind::Still));
|
||||
// JSON null is unspecified, not "on": the still stays a still.
|
||||
s.execute("file.replaceFootage", json!({"path": at(&dir, "shot_0004.png"), "sequence": null})).unwrap();
|
||||
let (name, f) = footage(&s, &item);
|
||||
assert_eq!((name.as_str(), f.kind), ("shot_0004.png", FootageKind::Still));
|
||||
// Asking for the run still brings it.
|
||||
s.execute("file.replaceFootage", json!({"path": at(&dir, "shot_0004.png"), "sequence": true})).unwrap();
|
||||
let (name, f) = footage(&s, &item);
|
||||
|
||||
Reference in New Issue
Block a user