Skip to content

Commit 73a523f

Browse files
authored
feat: Add asset title when importing videos from Mux (#425)
While importing videos from Mux, added fill title from meta if exists
1 parent 32e4538 commit 73a523f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/hooks/useImportMuxAssets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function muxAssetToSanityDocument(asset: MuxAsset): VideoAssetDocument | undefin
101101
_createdAt: parseMuxDate(asset.created_at).toISOString(),
102102
assetId: asset.id,
103103
playbackId,
104-
filename: `Asset #${truncateString(asset.id, 15)}`,
104+
filename: asset.meta?.title ?? `Asset #${truncateString(asset.id, 15)}`,
105105
status: asset.status,
106106
data: asset,
107107
}

src/util/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ export interface MuxAsset {
382382
unexpected_media_file_parameters?: 'non-standard'
383383
test?: boolean
384384
}
385+
meta?: {
386+
title?: string
387+
}
385388
}
386389

387390
export interface VideoAssetDocument {

0 commit comments

Comments
 (0)