sanity-plugin-mux-input 2.8.1 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-mux-input",
3
- "version": "2.8.1",
3
+ "version": "2.9.0",
4
4
  "description": "An input component that integrates Sanity Studio with Mux video encoding/hosting service.",
5
5
  "keywords": [
6
6
  "sanity",
@@ -5,7 +5,7 @@ export const useAccessControl = (config: PluginConfig) => {
5
5
  const user = useCurrentUser()
6
6
 
7
7
  const hasConfigAccess =
8
- !config?.allowedRolesForConfiguration ||
8
+ !config?.allowedRolesForConfiguration?.length ||
9
9
  user?.roles?.some((role) => config.allowedRolesForConfiguration.includes(role.name))
10
10
 
11
11
  return {hasConfigAccess}
@@ -101,7 +101,7 @@ function muxAssetToSanityDocument(asset: MuxAsset): VideoAssetDocument | undefin
101
101
  _createdAt: parseMuxDate(asset.created_at).toISOString(),
102
102
  assetId: asset.id,
103
103
  playbackId,
104
- filename: `Asset #${truncateString(asset.id, 15)}`,
104
+ filename: asset.meta?.title ?? `Asset #${truncateString(asset.id, 15)}`,
105
105
  status: asset.status,
106
106
  data: asset,
107
107
  }
package/src/util/types.ts CHANGED
@@ -382,6 +382,9 @@ export interface MuxAsset {
382
382
  unexpected_media_file_parameters?: 'non-standard'
383
383
  test?: boolean
384
384
  }
385
+ meta?: {
386
+ title?: string
387
+ }
385
388
  }
386
389
 
387
390
  export interface VideoAssetDocument {