MCPcopy Create free account
hub / github.com/decaporg/decap-cms / getMediaDisplayURL

Function getMediaDisplayURL

packages/decap-cms-lib-util/src/implementation.ts:386–400  ·  view source on GitHub ↗
(
  displayURL: DisplayURL,
  readFile: ReadFile,
  semaphore: Semaphore,
)

Source from the content-addressed store, hash-verified

384}
385
386export async function getMediaDisplayURL(
387 displayURL: DisplayURL,
388 readFile: ReadFile,
389 semaphore: Semaphore,
390) {
391 const { path, id } = displayURL as DisplayURLObject;
392 return new Promise<string>((resolve, reject) =>
393 semaphore.take(() =>
394 getMediaAsBlob(path, id, readFile)
395 .then(blob => URL.createObjectURL(blob))
396 .then(resolve, reject)
397 .finally(() => semaphore.leave()),
398 ),
399 );
400}
401
402export async function runWithLock(lock: AsyncLock, func: Function, message: string) {
403 try {

Callers 7

getMediaDisplayURLMethod · 0.90
getMediaDisplayURLMethod · 0.90
getMediaDisplayURLMethod · 0.90
getMediaDisplayURLMethod · 0.90
getMediaDisplayURLMethod · 0.90
getMediaDisplayURLMethod · 0.90

Calls 1

getMediaAsBlobFunction · 0.85

Tested by

no test coverage detected