@gallop.software/studio 1.5.8 → 1.5.10

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.
@@ -801,28 +801,27 @@ async function handleFolderImages(request) {
801
801
  const folders = foldersParam.split(",");
802
802
  const meta = await loadMeta();
803
803
  const fileEntries = getFileEntries(meta);
804
- const allImages = [];
804
+ const allFiles = [];
805
805
  const prefixes = folders.map((f) => {
806
806
  const rel = f.replace(/^public\/?/, "");
807
807
  return rel ? `/${rel}/` : "/";
808
808
  });
809
809
  for (const [key] of fileEntries) {
810
- const fileName = path5.basename(key);
811
- if (!isImageFile(fileName)) continue;
812
810
  for (const prefix of prefixes) {
813
811
  if (key.startsWith(prefix) || prefix === "/" && key.startsWith("/")) {
814
- allImages.push(key.slice(1));
812
+ allFiles.push(key.slice(1));
815
813
  break;
816
814
  }
817
815
  }
818
816
  }
819
817
  return NextResponse.json({
820
- count: allImages.length,
821
- images: allImages
818
+ count: allFiles.length,
819
+ images: allFiles
820
+ // Keep as 'images' for backwards compatibility
822
821
  });
823
822
  } catch (error) {
824
- console.error("Failed to get folder images:", error);
825
- return NextResponse.json({ error: "Failed to get folder images" }, { status: 500 });
823
+ console.error("Failed to get folder files:", error);
824
+ return NextResponse.json({ error: "Failed to get folder files" }, { status: 500 });
826
825
  }
827
826
  }
828
827