feat: integrate authored nightdrive soundtrack
This commit is contained in:
@@ -82,7 +82,7 @@ const readManifest = async (repositoryRoot) => {
|
||||
}
|
||||
if (ids.has(id)) throw new Error(`Duplicate manifest asset ID: ${id}`);
|
||||
ids.add(id);
|
||||
if (typeof fileName !== 'string' || !/^[a-z0-9][a-z0-9-]*\.(avif|jpg|png|svg|webp|mp4|webm)$/u.test(fileName)) {
|
||||
if (typeof fileName !== 'string' || !/^[a-z0-9][a-z0-9-]*\.(avif|jpg|png|svg|webp|mp4|webm|opus|mp3)$/u.test(fileName)) {
|
||||
throw new Error(`Manifest filename must be a generated safe filename: ${id}`);
|
||||
}
|
||||
const foldedFileName = fileName.toLocaleLowerCase('en-US');
|
||||
@@ -128,6 +128,18 @@ const assetReferences = (content) => {
|
||||
throw new Error('Portfolio content must contain metadata.');
|
||||
}
|
||||
if (content.metadata.socialPreviewAssetId !== undefined) references.push(content.metadata.socialPreviewAssetId);
|
||||
if (content.soundtrack !== undefined) {
|
||||
if (typeof content.soundtrack !== 'object' || content.soundtrack === null || Array.isArray(content.soundtrack)) {
|
||||
throw new Error('Portfolio soundtrack must be an object.');
|
||||
}
|
||||
for (const regionName of ['intro', 'main']) {
|
||||
const region = content.soundtrack[regionName];
|
||||
if (typeof region !== 'object' || region === null || Array.isArray(region)) {
|
||||
throw new Error(`Portfolio soundtrack ${regionName} must be an object.`);
|
||||
}
|
||||
references.push(region.opusAssetId, region.mp3AssetId);
|
||||
}
|
||||
}
|
||||
return references;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user