@gallop.software/studio 2.3.80 → 2.3.81

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.
@@ -776,23 +776,42 @@ async function handleList(request) {
776
776
  let fileSize;
777
777
  const entryIsProcessed = isProcessed(entry);
778
778
  if (isImage && entryIsProcessed) {
779
- const thumbPath = getThumbnailPath(key, "sm");
780
- if (isPushedToCloud && entry.c !== void 0) {
781
- const cdnUrl = cdnUrls[entry.c];
782
- if (cdnUrl) {
783
- thumbnail = `${cdnUrl}${thumbPath}`;
784
- hasThumbnail = true;
779
+ const hasSm = !!entry.sm;
780
+ const hasMd = !!entry.md;
781
+ const hasLg = !!entry.lg;
782
+ const hasFull = !!entry.f;
783
+ let thumbSize = null;
784
+ if (hasSm) thumbSize = "sm";
785
+ else if (hasMd) thumbSize = "md";
786
+ else if (hasLg) thumbSize = "lg";
787
+ else if (hasFull) thumbSize = "full";
788
+ if (thumbSize) {
789
+ const thumbPath = getThumbnailPath(key, thumbSize);
790
+ if (isPushedToCloud && entry.c !== void 0) {
791
+ const cdnUrl = cdnUrls[entry.c];
792
+ if (cdnUrl) {
793
+ thumbnail = `${cdnUrl}${thumbPath}`;
794
+ hasThumbnail = true;
795
+ }
796
+ } else {
797
+ const localThumbPath = getPublicPath(thumbPath);
798
+ try {
799
+ await fs4.access(localThumbPath);
800
+ thumbnail = thumbPath;
801
+ hasThumbnail = true;
802
+ } catch {
803
+ thumbnail = key;
804
+ hasThumbnail = false;
805
+ }
785
806
  }
786
807
  } else {
787
- const localThumbPath = getPublicPath(thumbPath);
788
- try {
789
- await fs4.access(localThumbPath);
790
- thumbnail = thumbPath;
791
- hasThumbnail = true;
792
- } catch {
808
+ if (isPushedToCloud && entry.c !== void 0) {
809
+ const cdnUrl = cdnUrls[entry.c];
810
+ thumbnail = cdnUrl ? `${cdnUrl}${key}` : key;
811
+ } else {
793
812
  thumbnail = key;
794
- hasThumbnail = false;
795
813
  }
814
+ hasThumbnail = false;
796
815
  }
797
816
  } else if (isImage) {
798
817
  if (isPushedToCloud && entry.c !== void 0) {
@@ -868,23 +887,42 @@ async function handleSearch(request) {
868
887
  let hasThumbnail = false;
869
888
  const entryIsProcessed = isProcessed(entry);
870
889
  if (isImage && entryIsProcessed) {
871
- const thumbPath = getThumbnailPath(key, "sm");
872
- if (isPushedToCloud && entry.c !== void 0) {
873
- const cdnUrl = cdnUrls[entry.c];
874
- if (cdnUrl) {
875
- thumbnail = `${cdnUrl}${thumbPath}`;
876
- hasThumbnail = true;
890
+ const hasSm = !!entry.sm;
891
+ const hasMd = !!entry.md;
892
+ const hasLg = !!entry.lg;
893
+ const hasFull = !!entry.f;
894
+ let thumbSize = null;
895
+ if (hasSm) thumbSize = "sm";
896
+ else if (hasMd) thumbSize = "md";
897
+ else if (hasLg) thumbSize = "lg";
898
+ else if (hasFull) thumbSize = "full";
899
+ if (thumbSize) {
900
+ const thumbPath = getThumbnailPath(key, thumbSize);
901
+ if (isPushedToCloud && entry.c !== void 0) {
902
+ const cdnUrl = cdnUrls[entry.c];
903
+ if (cdnUrl) {
904
+ thumbnail = `${cdnUrl}${thumbPath}`;
905
+ hasThumbnail = true;
906
+ }
907
+ } else {
908
+ const localThumbPath = getPublicPath(thumbPath);
909
+ try {
910
+ await fs4.access(localThumbPath);
911
+ thumbnail = thumbPath;
912
+ hasThumbnail = true;
913
+ } catch {
914
+ thumbnail = key;
915
+ hasThumbnail = false;
916
+ }
877
917
  }
878
918
  } else {
879
- const localThumbPath = getPublicPath(thumbPath);
880
- try {
881
- await fs4.access(localThumbPath);
882
- thumbnail = thumbPath;
883
- hasThumbnail = true;
884
- } catch {
919
+ if (isPushedToCloud && entry.c !== void 0) {
920
+ const cdnUrl = cdnUrls[entry.c];
921
+ thumbnail = cdnUrl ? `${cdnUrl}${key}` : key;
922
+ } else {
885
923
  thumbnail = key;
886
- hasThumbnail = false;
887
924
  }
925
+ hasThumbnail = false;
888
926
  }
889
927
  } else if (isImage) {
890
928
  if (isPushedToCloud && entry.c !== void 0) {