Live photo download no longer removes what was at its destination
check / check (push) Failing after 47s

The image and video are renamed into place, and the rename already
replaces the image's name, so the removal and the test that planted a
ZIP there are gone, along with the comments describing it.

Adds a test for a live photo the content cache recorded with no video,
because it opened before knowing the file is a live photo while no JSON
file named its image and video: original() fetches both again and writes
the JSON file. The comment on that check now names this case.

Model: opus-5-5
This commit is contained in:
2026-10-01 23:18:16 +00:00
parent 44b2859877
commit 5d11889e1a
4 changed files with 37 additions and 15 deletions
+3 -5
View File
@@ -361,8 +361,8 @@ const openPart = async (
// written unpacked: each part is named `destination` with the extension
// replaced by its own entry's, and the two must differ ignoring case. When the
// file records a hash, `<imageHash>:<videoHash>` must match it, each over that
// part's own bytes. Only then is whatever was at `destination` removed and the
// image, then the video, renamed into place; on any failure neither is stored.
// part's own bytes. Only then are the image, then the video, renamed into
// place; on any failure neither is stored.
//
// The ZIP is chosen by its uploader and may expand enormously, so each part is
// written as it decompresses and never held, and the ZIP is refused once the
@@ -486,7 +486,6 @@ const decryptLivePhoto = async (
await part.handle.sync();
await part.handle.close();
}
await rm(destination, { force: true });
await rename(image.tmpPath, path);
try {
await rename(video.tmpPath, videoPath);
@@ -570,8 +569,7 @@ const fetchAndDecrypt = async (
}, api.getRetryOptions());
// Write `file`'s original to `outPath`. A live photo is written as its image
// and its video beside `outPath` instead, and whatever was at `outPath` is
// removed (see `decryptLivePhoto`).
// and its video beside `outPath` instead (see `decryptLivePhoto`).
export const downloadFile = async (
api: ApiClient,
file: EnteFile,