Store live photos as their image and their video (closes #107)
check / check (push) Successful in 41s

A live photo, which Ente stores as one ZIP, is unpacked as it downloads
into its image and its video, each `<fileID>.<ext>` with its extension
from the ZIP, beside `<fileID>.livephoto.json`, which names the two.
Both are checked against the recorded hash and renamed into place only
when both are complete. A ZIP with a second image or video, or whose
parts come to more than 20 times its size plus 16 MiB, is refused. The
backup and the content cache count a live photo as stored only with both
files, album folders link both, `quak get` writes both, and the content
result gives the video as `videoPath`. A ZIP an earlier version stored
is replaced.

Model: opus-5-5
This commit was merged in pull request #128.
This commit is contained in:
2026-09-28 18:06:01 +02:00
parent 04094a8cfb
commit 9e6deb21eb
17 changed files with 1746 additions and 366 deletions
+8 -2
View File
@@ -397,7 +397,8 @@ export class Library {
originalsDays: opts.precacheOriginalsDays,
onEvent: opts.onProgress,
});
precache.update(deriveRecordsFromStore(store));
const records = deriveRecordsFromStore(store);
precache.update(records);
const extraPinned = opts.isOriginalPinned;
cache = new ContentCache({
pools,
@@ -411,7 +412,12 @@ export class Library {
precache!.isPinned(fileID) ||
(extraPinned?.(fileID) ?? false),
});
await cache.open();
// The records say at once which files are live photos, where
// `getFileByID` would search every file for each one cached.
await cache.open(
(fileID) =>
records.photos.get(fileID)?.fileType === "livePhoto",
);
precache.bind(cache);
}