sanity-plugin-r2-video 0.1.5 → 0.1.7

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.
@@ -1386,6 +1386,7 @@ var DialogDetails = ({
1386
1386
  fetchFolders(client, config.folders.type).then(setFolders);
1387
1387
  }, [client, config.folders.type]);
1388
1388
  const paths = resolveFolderPaths(folders);
1389
+ const isBroken = asset.renditions.length === 0;
1389
1390
  const trimmed = filename.trim();
1390
1391
  const savedFolderId = asset.folder ? asset.folder._ref : "";
1391
1392
  const isRenamed = trimmed.length > 0 && trimmed !== asset.filename;
@@ -1458,7 +1459,7 @@ var DialogDetails = ({
1458
1459
  onClick: isDirty ? reset : onClose
1459
1460
  }
1460
1461
  ) }),
1461
- /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(
1462
+ !isBroken && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(
1462
1463
  Button,
1463
1464
  {
1464
1465
  disabled: isSaving || !isDirty,
@@ -1469,7 +1470,7 @@ var DialogDetails = ({
1469
1470
  }
1470
1471
  ) })
1471
1472
  ] }) }),
1472
- children: /* @__PURE__ */ jsx(Card, { padding: 4, children: /* @__PURE__ */ jsxs(Stack, { gap: 5, children: [
1473
+ children: /* @__PURE__ */ jsx(Card, { padding: 4, children: isBroken ? /* @__PURE__ */ jsx(Card, { padding: 4, radius: 2, tone: "caution", children: /* @__PURE__ */ jsx(Text, { size: 1, children: "This video was never finished uploading, so it has no renditions and nothing stored behind it. Delete it." }) }) : /* @__PURE__ */ jsxs(Stack, { gap: 5, children: [
1473
1474
  /* @__PURE__ */ jsx(
1474
1475
  VideoPreview,
1475
1476
  {
@@ -1708,17 +1709,11 @@ var FolderSidebar = ({
1708
1709
  var QUERY_ASSETS = `*[_type == "r2Video.asset"] | order(uploadedAt desc){
1709
1710
  _id,
1710
1711
  _type,
1711
-
1712
- // Both are absent on a document the pipeline never finished, and every
1713
- // consumer of this query treats them as present
1714
1712
  "filename": coalesce(filename, ""),
1715
1713
  folder,
1716
1714
  poster,
1717
- duration,
1718
- hasAudio,
1719
-
1720
- // A document the pipeline never finished - Sanity's own create button made
1721
- // these before the reference field disabled it - has no renditions at all
1715
+ "duration": coalesce(duration, 0),
1716
+ "hasAudio": coalesce(hasAudio, false),
1722
1717
  "renditions": coalesce(renditions, []),
1723
1718
  uploadedAt,
1724
1719
  "posterUrl": poster.asset->url,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-r2-video",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Video for Sanity Studio, encoded in the browser and stored in Cloudflare R2 as a ladder of plain MP4s.",
5
5
  "keywords": [
6
6
  "sanity",