合并编辑器素材修复分支
合并 codex/240e-editor-asset-fixes 到 codex/editor-asset-library 保留视频生成资源与素材返回 保留视频缩略图与生成输入元数据
This commit is contained in:
@@ -692,6 +692,7 @@ export function mapAssetLibrarySnapshot(
|
||||
const mediaType = inferEditorAssetMediaType(
|
||||
asset.imageSrc,
|
||||
asset.objectKey ?? undefined,
|
||||
asset.assetKind,
|
||||
);
|
||||
return {
|
||||
id: asset.assetId,
|
||||
@@ -725,7 +726,14 @@ export function mapAssetLibrarySnapshot(
|
||||
export function inferEditorAssetMediaType(
|
||||
imageSrc: string,
|
||||
objectKey?: string | null,
|
||||
assetKind?: string | null,
|
||||
): CanvasMediaType {
|
||||
if (assetKind === 'video') {
|
||||
return 'video';
|
||||
}
|
||||
if (assetKind === 'sound-effect' || assetKind === 'background-music') {
|
||||
return 'audio';
|
||||
}
|
||||
const source = `${objectKey ?? ''} ${imageSrc}`.toLowerCase();
|
||||
const sourceWithoutQuery = source.split(/[?#]/u)[0] ?? source;
|
||||
if (sourceWithoutQuery.includes('.mp4')) {
|
||||
|
||||
Reference in New Issue
Block a user