Handle lp retry

This commit is contained in:
Manav Rathi
2025-05-27 15:19:16 +05:30
parent de918f42e6
commit cbf3340bf2
2 changed files with 8 additions and 5 deletions

View File

@@ -664,7 +664,7 @@ class UploadManager {
*/
public failedItemState() {
return {
items: this.failedItems,
items: [...this.failedItems],
collections: [...this.collections.values()],
parsedMetadataJSONMap: this.parsedMetadataJSONMap,
};
@@ -813,12 +813,15 @@ const clusterLivePhotos = async (
});
index += 2;
} else {
result.push({ ...f, isLivePhoto: false });
// They may already be a live photo (we might be retrying a
// previously failed upload).
result.push({ ...f, isLivePhoto: f.isLivePhoto ?? false });
index += 1;
}
}
if (index === items.length - 1) {
result.push({ ...items[index], isLivePhoto: false });
if (index == items.length - 1) {
const f = items[index]!;
result.push({ ...f, isLivePhoto: f.isLivePhoto ?? false });
}
return result;
};

View File

@@ -56,6 +56,7 @@ import { ensureInteger, ensureNumber } from "ente-utils/ensure";
import type { UploadableUploadItem, UploadItem, UploadPathPrefix } from ".";
import { type LivePhotoAssets, type UploadResult } from ".";
import { tryParseEpochMicrosecondsFromFileName } from "./date";
import { matchJSONMetadata, type ParsedMetadataJSON } from "./metadata-json";
import {
completeMultipartUpload,
completeMultipartUploadViaWorker,
@@ -72,7 +73,6 @@ import {
type MultipartCompletedPart,
type ObjectUploadURL,
} from "./remote";
import { type ParsedMetadataJSON, matchJSONMetadata } from "./metadata-json";
import {
fallbackThumbnail,
generateThumbnailNative,