fix(media-use): ingest derived video outputs (#2310)

* fix(media-use): ingest derived video outputs

* style(media-use): keep ingest types after imports
This commit is contained in:
Miguel Ángel
2026-07-12 22:30:31 -04:00
committed by GitHub
parent 38badff820
commit 7c0dcb0b14
3 changed files with 20 additions and 3 deletions
+1 -1
View File
@@ -46,7 +46,7 @@
"files": 10
},
"media-use": {
"hash": "8fd94ced0d1daee6",
"hash": "14d15dedf7acd4ed",
"files": 124
},
"motion-graphics": {
+5 -2
View File
@@ -36,6 +36,8 @@ import {
versionLessThan,
} from "./lib/heygen-cli.mjs";
const INGEST_TYPES = [...listTypes(), "video"];
// resolve shells `fetch`/`freezeUrl` and modern ESM; 18 is the floor where those
// exist without flags. Named so the --doctor node check verifies something real
// (O2). Declared before the top-level `--doctor` branch that calls runDoctor().
@@ -731,8 +733,8 @@ async function resolveColor(type, intent, options) {
}
async function ingest(src) {
if (!type || !listTypes().includes(type)) {
console.error(`error: --from requires --type (one of: ${listTypes().join(", ")})`);
if (!type || !INGEST_TYPES.includes(type)) {
console.error(`error: --from requires --type (one of: ${INGEST_TYPES.join(", ")})`);
process.exit(2);
}
const isUrl = /^https?:\/\//i.test(src);
@@ -1146,6 +1148,7 @@ const DEFAULT_EXT = {
icon: ".svg",
logo: ".svg",
brand: ".png",
video: ".mp4",
grade: ".cube",
lut: ".cube",
};
+14
View File
@@ -455,6 +455,20 @@ test("--help exits 0", () => {
assert.ok(out.includes("--stats"));
});
test("--from registers a derived video as documented", () => {
setup();
const source = join(tmp, "derived.mp4");
writeFileSync(source, "derived video bytes");
const out = runResolve(["--from", source, "--type", "video", "--project", tmp, "--json"]);
const parsed = JSON.parse(out.trim());
assert.equal(parsed.ok, true);
assert.equal(parsed.type, "video");
assert.match(parsed.path, /^\.media\/video\/video_001\.mp4$/);
assert.equal(readManifest(tmp)[0]?.type, "video");
cleanup();
});
test("unknown type error lists grade and lut", () => {
try {
runResolve(["--type", "bogus", "--intent", "x"], { stdio: "pipe" });