Repository navigation
Bundle fixes - #2060
Bundle fixes#2060darbyjohnston merged 7 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2060 +/- ##
=======================================
Coverage 83.61% 83.62%
=======================================
Files 183 184 +1
Lines 13580 13627 +47
Branches 1261 1270 +9
=======================================
+ Hits 11355 11395 +40
- Misses 2052 2059 +7
Partials 173 173
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
@ssteinbach do you recall if we intended otiod bundles to have version.txt or not? |
|
Added some more fixes:
|
|
@jminor I double checked the docs and .otiod is missing the version file: It seems like a reasonable thing to add so the formats have parity? That way an .otiod can be zipped to become a valid .otioz bundle. Or I can create a PR to remove it so the functionality stays the same as the original adapters. |
|
FYI, I discussed with @ssteinbach and he agrees with you @darbyjohnston - go for it. |
A bundle is written with a version file, and read_otiod refused to read one without it. The adapter that wrote otiod bundles before this never wrote one, so every bundle made until now was refused -- and read_otioz asks for no such thing, so the two halves of the format disagreed. The file is still written. It is no longer required to read, and nothing is lost by that: its contents were never read, only its presence tested. Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
The policy used to be a string, and the documentation still gives the
commandline for one:
otioconvert -i in.otio -o out.otioz -A media_policy="AllMissing"
That has not worked since the policy became an enumeration. An adapter
argument off the commandline is always text, and the text went straight to
the enumeration, which does not take it. Neither spelling worked: not
AllMissing, which is documented, nor all_missing, which is what the
enumeration calls it. The policy could not be set from the commandline at
all.
The adapters now read either spelling, which is where it belongs: they are
the edge where untyped arguments arrive. The enumeration stays strict for
everyone who already has a value to pass, and a name that is neither says
so rather than failing as a type error further in.
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
The Python adapter builds a ReadOptions and calls read_otiod, so the test walked the bindings into the same code the C++ test covers. Whether a bundle without a version file reads is settled there. Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Both bundle adapters call the same conversion, and the otiod test already covers both spellings and a value that is neither. Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
std::filesystem throws on errors like a directory without permission, and several of those calls were outside the try blocks, so the exception escaped write_otioz and the others. The public functions now catch whatever escapes and set the error status. The readers also hold the timeline in a Retainer so it is not leaked when they return an error. percent_decode called std::stoi on whatever followed a '%', which threw for a URL like "file:///media/100%.mov". A '%' is now only an escape when two hex digits follow it. Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
std::filesystem::status() also sets the error code when the file does not exist, so the test ran on Windows, where removing the permissions only makes the directory read-only and files can still be written to it. exists() only sets the error code for errors like permission denied. Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
37fa06b to
943e515
Compare
|
Thanks, I'll go ahead and merge then. |
0bfd9d6
into
AcademySoftwareFoundation:main
While testing the new bundle support I found a couple of bugs:
version.txtfiles to .otiod bundles, so we shouldn't throw an error if it is missing. That way older .otiod files remain readable. The new C++ code does writeversion.txtfiles to both .otiod and .otioz bundles.🤖 Generated with Claude Code using Claude Opus 5