@gallop.software/studio 2.3.21 → 2.3.22

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.
@@ -1667,22 +1667,31 @@ async function handleUnprocessStream(request) {
1667
1667
  if (!imageKey.startsWith("/")) {
1668
1668
  imageKey = `/${imageKey}`;
1669
1669
  }
1670
- sendEvent({
1671
- type: "progress",
1672
- current: i + 1,
1673
- total,
1674
- percent: Math.round((i + 1) / total * 100),
1675
- message: `Removing thumbnails for ${imageKey.slice(1)}...`
1676
- });
1677
1670
  try {
1678
1671
  const entry = getMetaEntry(meta, imageKey);
1679
1672
  if (!entry) {
1680
1673
  errors.push(imageKey);
1674
+ sendEvent({
1675
+ type: "progress",
1676
+ current: i + 1,
1677
+ total,
1678
+ processed: removed.length,
1679
+ percent: Math.round((i + 1) / total * 100),
1680
+ message: `Error: ${imageKey.slice(1)}`
1681
+ });
1681
1682
  continue;
1682
1683
  }
1683
1684
  const hasThumbnails = entry.sm || entry.md || entry.lg || entry.f;
1684
1685
  if (!hasThumbnails) {
1685
1686
  skipped.push(imageKey);
1687
+ sendEvent({
1688
+ type: "progress",
1689
+ current: i + 1,
1690
+ total,
1691
+ processed: removed.length,
1692
+ percent: Math.round((i + 1) / total * 100),
1693
+ message: `Skipped ${imageKey.slice(1)} (no thumbnails)`
1694
+ });
1686
1695
  continue;
1687
1696
  }
1688
1697
  const existingCdnIndex = entry.c;
@@ -1698,9 +1707,25 @@ async function handleUnprocessStream(request) {
1698
1707
  ...entry.c !== void 0 ? { c: entry.c } : {}
1699
1708
  };
1700
1709
  removed.push(imageKey);
1710
+ sendEvent({
1711
+ type: "progress",
1712
+ current: i + 1,
1713
+ total,
1714
+ processed: removed.length,
1715
+ percent: Math.round((i + 1) / total * 100),
1716
+ message: `Removed thumbnails for ${imageKey.slice(1)}`
1717
+ });
1701
1718
  } catch (error) {
1702
1719
  console.error(`Failed to unprocess ${imageKey}:`, error);
1703
1720
  errors.push(imageKey);
1721
+ sendEvent({
1722
+ type: "progress",
1723
+ current: i + 1,
1724
+ total,
1725
+ processed: removed.length,
1726
+ percent: Math.round((i + 1) / total * 100),
1727
+ message: `Failed: ${imageKey.slice(1)}`
1728
+ });
1704
1729
  }
1705
1730
  }
1706
1731
  sendEvent({ type: "cleanup", message: "Saving metadata..." });
@@ -1773,13 +1798,6 @@ async function handleReprocessStream(request) {
1773
1798
  if (!imageKey.startsWith("/")) {
1774
1799
  imageKey = `/${imageKey}`;
1775
1800
  }
1776
- sendEvent({
1777
- type: "progress",
1778
- current: i + 1,
1779
- total,
1780
- percent: Math.round((i + 1) / total * 100),
1781
- message: `Processing ${imageKey.slice(1)}...`
1782
- });
1783
1801
  try {
1784
1802
  let buffer;
1785
1803
  const entry = getMetaEntry(meta, imageKey);
@@ -1839,9 +1857,25 @@ async function handleReprocessStream(request) {
1839
1857
  meta[imageKey] = updatedEntry;
1840
1858
  }
1841
1859
  processed.push(imageKey);
1860
+ sendEvent({
1861
+ type: "progress",
1862
+ current: i + 1,
1863
+ total,
1864
+ processed: processed.length,
1865
+ percent: Math.round((i + 1) / total * 100),
1866
+ message: `Processed ${imageKey.slice(1)}`
1867
+ });
1842
1868
  } catch (error) {
1843
1869
  console.error(`Failed to reprocess ${imageKey}:`, error);
1844
1870
  errors.push(imageKey);
1871
+ sendEvent({
1872
+ type: "progress",
1873
+ current: i + 1,
1874
+ total,
1875
+ processed: processed.length,
1876
+ percent: Math.round((i + 1) / total * 100),
1877
+ message: `Failed: ${imageKey.slice(1)}`
1878
+ });
1845
1879
  }
1846
1880
  }
1847
1881
  sendEvent({ type: "cleanup", message: "Saving metadata..." });
@@ -1915,6 +1949,7 @@ async function handleDownloadStream(request) {
1915
1949
  type: "progress",
1916
1950
  current: i + 1,
1917
1951
  total: imageKeys.length,
1952
+ downloaded: downloaded.length,
1918
1953
  message: `Skipped ${imageKey} (not on cloud)`
1919
1954
  });
1920
1955
  continue;
@@ -2039,20 +2074,29 @@ async function handlePushUpdatesStream(request) {
2039
2074
  const itemPath = paths[i];
2040
2075
  const key = itemPath.startsWith("public/") ? "/" + itemPath.slice(7) : itemPath;
2041
2076
  const entry = meta[key];
2042
- sendEvent({
2043
- type: "progress",
2044
- current: i + 1,
2045
- total,
2046
- percent: Math.round((i + 1) / total * 100),
2047
- currentFile: path7.basename(key)
2048
- });
2049
2077
  if (!entry || entry.u !== 1) {
2050
2078
  skipped.push(key);
2079
+ sendEvent({
2080
+ type: "progress",
2081
+ current: i + 1,
2082
+ total,
2083
+ pushed: pushed.length,
2084
+ percent: Math.round((i + 1) / total * 100),
2085
+ currentFile: path7.basename(key)
2086
+ });
2051
2087
  continue;
2052
2088
  }
2053
2089
  const fileCdnUrl = entry.c !== void 0 ? cdnUrls[entry.c]?.replace(/\/$/, "") : void 0;
2054
2090
  if (!fileCdnUrl || fileCdnUrl !== r2PublicUrl) {
2055
2091
  skipped.push(key);
2092
+ sendEvent({
2093
+ type: "progress",
2094
+ current: i + 1,
2095
+ total,
2096
+ pushed: pushed.length,
2097
+ percent: Math.round((i + 1) / total * 100),
2098
+ currentFile: path7.basename(key)
2099
+ });
2056
2100
  continue;
2057
2101
  }
2058
2102
  try {
@@ -2083,9 +2127,26 @@ async function handlePushUpdatesStream(request) {
2083
2127
  await fs7.unlink(localPath);
2084
2128
  delete entry.u;
2085
2129
  pushed.push(key);
2130
+ sendEvent({
2131
+ type: "progress",
2132
+ current: i + 1,
2133
+ total,
2134
+ pushed: pushed.length,
2135
+ percent: Math.round((i + 1) / total * 100),
2136
+ currentFile: path7.basename(key)
2137
+ });
2086
2138
  } catch (error) {
2087
2139
  console.error(`Failed to push update for ${key}:`, error);
2088
2140
  errors.push(key);
2141
+ sendEvent({
2142
+ type: "progress",
2143
+ current: i + 1,
2144
+ total,
2145
+ pushed: pushed.length,
2146
+ percent: Math.round((i + 1) / total * 100),
2147
+ currentFile: path7.basename(key),
2148
+ message: `Failed: ${path7.basename(key)}`
2149
+ });
2089
2150
  }
2090
2151
  }
2091
2152
  sendEvent({ type: "cleanup", message: "Cleaning up..." });