mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-17 08:54:42 +00:00
interchange: retain EDL guessed-path bounds with current Film metadata
This commit is contained in:
@@ -201,8 +201,8 @@ const EDL_MEDIA_TIME_NOTE: &str = "EDL source timecodes were imported as media t
|
||||
/// The largest start timecode, in frames, a file may have: a day at 1000 fps.
|
||||
const MAX_FILE_TIMECODE: i64 = 24 * 3600 * 1000;
|
||||
|
||||
/// The paths an EDL reader guessed (media it flags offline: a line without `SOURCE FILE` names
|
||||
/// only its clip) that are not inside the list's folder: a clip name of `../x.mov` or an absolute
|
||||
/// The paths an EDL reader guessed (identified by its `Tape Name` metadata: a line without
|
||||
/// `SOURCE FILE` names only its clip) that are not inside the list's folder: a clip name of `../x.mov` or an absolute
|
||||
/// one would link a file elsewhere on the disk. They stay placeholders. A `SOURCE FILE` path is
|
||||
/// the list's own choice and is kept, also when another clip guesses the same path.
|
||||
fn guessed_outside(project: &fp::Project, base_dir: Option<&str>) -> HashSet<String> {
|
||||
@@ -219,7 +219,9 @@ fn guessed_outside(project: &fp::Project, base_dir: Option<&str>) -> HashSet<Str
|
||||
if let fp::ItemKind::Media(m) = &it.kind
|
||||
&& let fp::MediaRef::File { path } = &m.media
|
||||
{
|
||||
if m.offline && !inside(path) {
|
||||
// Film reserves `offline` for an explicit user action now. Its EDL reader sets
|
||||
// Tape Name only on reel/clip-name guesses, never on SOURCE FILE references.
|
||||
if it.metadata.contains_key("Tape Name") && !inside(path) {
|
||||
guessed.insert(path.clone());
|
||||
} else {
|
||||
named.insert(path.clone());
|
||||
|
||||
@@ -883,3 +883,17 @@ fn import_finds_each_clips_transitions_without_scanning_the_track() {
|
||||
let mid = m.layers.iter().find(|l| near(l.in_point, t(100.0 - 0.08))).expect("clip 250 extended into its incoming transition");
|
||||
assert!(near(mid.out_point, t(100.4 + 0.08)), "{}", mid.out_point.seconds());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn edl_explicit_source_file_allows_the_same_path_as_an_outside_guess() {
|
||||
let edl = b"TITLE: CUT\nFCM: NON-DROP FRAME\n\n001 A001 V C 00:00:00:00 00:00:01:00 00:00:00:00 00:00:01:00\n* FROM CLIP NAME: ../shared.mov\n\n002 A002 V C 00:00:00:00 00:00:01:00 00:00:01:00 00:00:02:00\n* FROM CLIP NAME: named.mov\n* SOURCE FILE: /shared.mov\n";
|
||||
let mut asked = Vec::new();
|
||||
let mut probe_all = |path: &str| {
|
||||
asked.push(path.to_string());
|
||||
probe(path)
|
||||
};
|
||||
let mut p = Project::default();
|
||||
let opts = ImportOptions { name: "hand.edl".into(), edl_frame_rate: Some(25.0), base_dir: Some("/work".into()) };
|
||||
import(&mut p, edl, None, &opts, &mut probe_all).unwrap();
|
||||
assert_eq!(asked, ["/shared.mov"], "explicit SOURCE FILE permits the shared path, probed once");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user