perf(frontend): parallelize video thumbs, batch owner-cache writes, minor tweaks

- photos: generate + upload the three video-thumbnail sizes in parallel via
  Promise.allSettled instead of a sequential await loop; previewData is still
  captured before its upload so the local preview survives a failed upload.
- useOwnerCache: resolve the batch, then apply a single reactive assignment
  to `#names` instead of spread-copying the record once per id (fewer copies
  and fewer derive re-runs on large resolves).
- admin: migration status polling slowed from 2s to 5s.
- files store: soft cap (10k) on the per-item selection toggle. Bulk
  "select all" in the views is intentionally left uncapped.
This commit is contained in:
Claude
2026-06-19 23:06:12 +00:00
parent c60506cc36
commit f831636cf9
4 changed files with 26 additions and 14 deletions
+1 -1
View File
@@ -320,7 +320,7 @@
try {
migration = await getMigration();
if (migration.status === 'running') {
if (!migrationTimer) migrationTimer = setInterval(loadMigration, 2000);
if (!migrationTimer) migrationTimer = setInterval(loadMigration, 5000);
} else {
stopMigrationPoll();
}
+10 -5
View File
@@ -301,11 +301,16 @@
['large', 800, 800]
];
let previewData = '';
for (const [size, w, h] of SIZES) {
const blob = await bitmapToBlob(bitmap, w, h);
if (size === 'preview') previewData = await blobToDataUrl(blob);
await uploadThumbnail(file.id, size, blob).catch(() => {});
}
// Render the blobs and push all three sizes in parallel; `previewData`
// is captured before its upload so the local preview shows even if that
// upload fails (allSettled swallows per-size failures, as before).
await Promise.allSettled(
SIZES.map(async ([size, w, h]) => {
const blob = await bitmapToBlob(bitmap, w, h);
if (size === 'preview') previewData = await blobToDataUrl(blob);
await uploadThumbnail(file.id, size, blob);
})
);
if (previewData) videoThumbs = { ...videoThumbs, [file.id]: previewData };
} catch {
// Keep the generic play badge on failure.