@gallop.software/studio 1.5.2 → 1.5.4
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/dist/{StudioUI-2UVUYHHA.js → StudioUI-JNACMWLN.js} +76 -29
- package/dist/StudioUI-JNACMWLN.js.map +1 -0
- package/dist/{StudioUI-74IZDKCP.mjs → StudioUI-NLB3VZAZ.mjs} +76 -29
- package/dist/StudioUI-NLB3VZAZ.mjs.map +1 -0
- package/dist/{chunk-FOKLOMKO.mjs → chunk-TRYWHLJ2.mjs} +1 -1
- package/dist/chunk-TRYWHLJ2.mjs.map +1 -0
- package/dist/{chunk-X6F6IFY3.js → chunk-VI6QG6WT.js} +1 -1
- package/dist/chunk-VI6QG6WT.js.map +1 -0
- package/dist/handlers/index.js +49 -39
- package/dist/handlers/index.js.map +1 -1
- package/dist/handlers/index.mjs +16 -6
- package/dist/handlers/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/StudioUI-2UVUYHHA.js.map +0 -1
- package/dist/StudioUI-74IZDKCP.mjs.map +0 -1
- package/dist/chunk-FOKLOMKO.mjs.map +0 -1
- package/dist/chunk-X6F6IFY3.js.map +0 -1
package/dist/handlers/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getAllThumbnailPaths,
|
|
3
3
|
getThumbnailPath,
|
|
4
4
|
isProcessed
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-TRYWHLJ2.mjs";
|
|
6
6
|
|
|
7
7
|
// src/handlers/index.ts
|
|
8
8
|
import { NextResponse as NextResponse6 } from "next/server";
|
|
@@ -343,19 +343,25 @@ function getExistingThumbnails(originalPath, entry) {
|
|
|
343
343
|
}
|
|
344
344
|
return thumbnails;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function countFileTypes(folderPrefix, fileEntries, cdnUrls, r2PublicUrl) {
|
|
347
347
|
let cloudCount = 0;
|
|
348
|
+
let remoteCount = 0;
|
|
348
349
|
let localCount = 0;
|
|
349
350
|
for (const [key, entry] of fileEntries) {
|
|
350
351
|
if (key.startsWith(folderPrefix)) {
|
|
351
352
|
if (entry.c !== void 0) {
|
|
352
|
-
|
|
353
|
+
const cdnUrl = cdnUrls[entry.c];
|
|
354
|
+
if (cdnUrl === r2PublicUrl) {
|
|
355
|
+
cloudCount++;
|
|
356
|
+
} else {
|
|
357
|
+
remoteCount++;
|
|
358
|
+
}
|
|
353
359
|
} else {
|
|
354
360
|
localCount++;
|
|
355
361
|
}
|
|
356
362
|
}
|
|
357
363
|
}
|
|
358
|
-
return { cloudCount, localCount };
|
|
364
|
+
return { cloudCount, remoteCount, localCount };
|
|
359
365
|
}
|
|
360
366
|
async function handleList(request) {
|
|
361
367
|
const searchParams = request.nextUrl.searchParams;
|
|
@@ -477,6 +483,7 @@ async function handleList(request) {
|
|
|
477
483
|
const folderPath = relativePath ? `public/${relativePath}/${entry.name}` : `public/${entry.name}`;
|
|
478
484
|
let fileCount = 0;
|
|
479
485
|
let cloudCount = 0;
|
|
486
|
+
let remoteCount = 0;
|
|
480
487
|
let localCount = 0;
|
|
481
488
|
if (isImagesFolder) {
|
|
482
489
|
for (const [key, metaEntry] of fileEntries) {
|
|
@@ -489,8 +496,9 @@ async function handleList(request) {
|
|
|
489
496
|
for (const k of metaKeys) {
|
|
490
497
|
if (k.startsWith(folderPrefix)) fileCount++;
|
|
491
498
|
}
|
|
492
|
-
const counts =
|
|
499
|
+
const counts = countFileTypes(folderPrefix, fileEntries, cdnUrls, r2PublicUrl);
|
|
493
500
|
cloudCount = counts.cloudCount;
|
|
501
|
+
remoteCount = counts.remoteCount;
|
|
494
502
|
localCount = counts.localCount;
|
|
495
503
|
}
|
|
496
504
|
items.push({
|
|
@@ -499,6 +507,7 @@ async function handleList(request) {
|
|
|
499
507
|
type: "folder",
|
|
500
508
|
fileCount,
|
|
501
509
|
cloudCount,
|
|
510
|
+
remoteCount,
|
|
502
511
|
localCount,
|
|
503
512
|
isProtected: isImagesFolder
|
|
504
513
|
});
|
|
@@ -542,13 +551,14 @@ async function handleList(request) {
|
|
|
542
551
|
for (const k of metaKeys) {
|
|
543
552
|
if (k.startsWith(folderPrefix)) fileCount++;
|
|
544
553
|
}
|
|
545
|
-
const counts =
|
|
554
|
+
const counts = countFileTypes(folderPrefix, fileEntries, cdnUrls, r2PublicUrl);
|
|
546
555
|
items.push({
|
|
547
556
|
name: folderName,
|
|
548
557
|
path: relativePath ? `public/${relativePath}/${folderName}` : `public/${folderName}`,
|
|
549
558
|
type: "folder",
|
|
550
559
|
fileCount,
|
|
551
560
|
cloudCount: counts.cloudCount,
|
|
561
|
+
remoteCount: counts.remoteCount,
|
|
552
562
|
localCount: counts.localCount,
|
|
553
563
|
isProtected: isInsideImagesFolder
|
|
554
564
|
});
|