@gallop.software/studio 1.2.3 → 1.2.5

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.
@@ -355,6 +355,12 @@ async function handleList(request) {
355
355
  }
356
356
  for (const thumb of allThumbnails) {
357
357
  const thumbRelative = thumb.path.replace(/^\/images\/?/, "");
358
+ const originalEntry = fileEntries.find(([k]) => k === thumb.originalKey)?.[1];
359
+ const cdnIndex = originalEntry?.c;
360
+ const cdnBaseUrl = cdnIndex !== void 0 ? cdnUrls[cdnIndex] : void 0;
361
+ const thumbnailUrl = cdnBaseUrl ? `${cdnBaseUrl}${thumb.path}` : thumb.path;
362
+ const isPushedToCloud = cdnIndex !== void 0;
363
+ const isRemote = isPushedToCloud && cdnBaseUrl !== r2PublicUrl;
358
364
  if (imagesSubPath === "") {
359
365
  const slashIndex = thumbRelative.indexOf("/");
360
366
  if (slashIndex === -1) {
@@ -363,9 +369,12 @@ async function handleList(request) {
363
369
  name: fileName,
364
370
  path: `public/images/${fileName}`,
365
371
  type: "file",
366
- thumbnail: thumb.path,
372
+ thumbnail: thumbnailUrl,
367
373
  hasThumbnail: false,
368
- isProtected: true
374
+ isProtected: true,
375
+ cdnPushed: isPushedToCloud,
376
+ cdnBaseUrl,
377
+ isRemote
369
378
  });
370
379
  } else {
371
380
  const folderName = thumbRelative.slice(0, slashIndex);
@@ -394,9 +403,12 @@ async function handleList(request) {
394
403
  name: remaining,
395
404
  path: `public/images/${imagesSubPath}/${remaining}`,
396
405
  type: "file",
397
- thumbnail: thumb.path,
406
+ thumbnail: thumbnailUrl,
398
407
  hasThumbnail: false,
399
- isProtected: true
408
+ isProtected: true,
409
+ cdnPushed: isPushedToCloud,
410
+ cdnBaseUrl,
411
+ isRemote
400
412
  });
401
413
  } else {
402
414
  const folderName = remaining.slice(0, slashIndex);