Repository navigation
Import FCPXML bundles - #24
Merged
Merged
Conversation
Every .xml path was imported as a timeline. Canon writes clip metadata as XML beside each clip, so selecting a clip together with its XML, or two clips' XML files, stopped the whole run with "No FCP 7 XML sequence was found" or "Add one timeline at a time". Folder imports already skipped these files. An XML file is now a timeline only when its root element is FCP 7 xmeml or fcpxml; recognizing that reads at most 16 KiB. A UTF-16 file is decoded to find its root, so a UTF-16 project is still reported as unreadable instead of skipped. Files that cannot be read or parsed still count as timelines, so their import reports why. The app recognizes timeline inputs once, when they are added, and rendering no longer reads files. The timeline import error also lost its doubled final period.
Final Cut Pro 10.6 and later export FCPXML as a .fcpxmld bundle: a directory whose Info.fcpxml is the document. Align did not recognize the extension, and expanding inputs scanned the bundle as a folder of media, so adding one gave "No readable audio or video media was found." A .fcpxmld bundle is now a timeline: it is read through its Info.fcpxml, and errors and warnings name the bundle. Folder scans do not enter bundles. FCPXML media URLs relative to the document now resolve against its folder (the bundle root) and are percent-decoded; they used to resolve against the working directory. A repaired copy saved as .fcpxmld is a bundle again: the source bundle is copied, links and folder permissions kept, with its document rewritten. It is built beside the destination and swapped in; an existing destination must be a bundle, is moved aside and moved back if the swap fails. The destination may neither lie inside the source nor contain it, and copying can be cancelled. Relative media that would no longer resolve from the copy's location become absolute file URLs.
On Windows the copied bundle follows links, and the unused file type failed clippy.
Windows refuses to rename a folder that holds an open file, so every repaired bundle failed there with "Access is denied."
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on
fix/camera-xml-sidecars, whose timeline recognition thisextends.
Final Cut Pro 10.6 and later export FCPXML as a
.fcpxmldbundle: adirectory whose
Info.fcpxmlis the document. Align did not recognize theextension, and input expansion scanned the bundle as a folder of media, so
adding one ended in "No readable audio or video media was found."
Reading:
.fcpxmlddirectory is a timeline. Reading it and listing its sequencesuse its
Info.fcpxml. Errors (ImportError::naming), warnings and thedraft's source name the bundle the user added, not
Info.fcpxml.which for a bundle is the bundle root, and are percent-decoded. Before,
they resolved against the working directory (for plain
.fcpxmlfilestoo), so a bundle carrying
./Media/…found no media.may be a bundle directory. Folder scans do not enter bundles, so media
inside one are not loose clips.
Repaired copies (Path Fixer,
align-clifixed copies):.fcpxmlddestination is written as a bundle: a copy of the sourcebundle (symbolic links kept as links on Unix, folder permissions kept) with
its document rewritten. It is built in a temporary folder beside the
destination. An existing destination must itself be a bundle; it is moved
aside, the new bundle takes its place, and the old one is moved back if
that fails, so no failure loses either. This also avoids renaming a
directory onto an existing path, which Windows does not allow.
nested bundle) nor contain it, compared as resolved paths.
become absolute file URLs; those pointing into a bundle that is copied
along stay relative (
Relocationinrewrite_media_paths)..fcpxmldestination receives the repaired document alone.Tests, each checked by removing the corresponding fix:
fcpxml_bundles_are_read_through_their_documentbundle_media_resolve_against_the_bundle,fcpxml_media_may_be_relative_to_the_document(core)repaired_bundle_copies_keep_the_bundle(copied files, replaced stalebundle, unchanged source, no leftovers beside it)
repaired_copies_keep_relative_media_resolvingrepaired_bundles_never_overwrite_the_source_or_other_folders(documentinside the source, nested bundle, source inside the destination, a
non-bundle folder)
a_cancelled_bundle_copy_leaves_the_destinationbundle_copies_keep_symbolic_links(Unix)fcpxml_bundles_beside_media_are_imported_as_timelines,folder_scans_do_not_enter_fcpxml_bundlesNot changed: an FCPXML document without a sequence still reports "No FCP 7
XML sequence was found" (the existing wording for both XML formats), and the
Path Fixer still appends a missing extension after the save panel returns.
Validation:
cargo fmt --all -- --checkcargo clippy --locked --workspace --all-targets -- -D warningscargo test --locked --workspace: 386 passed, 1 ignored