Store live photos as their image and their video (closes #107)
check / check (push) Successful in 40s
check / check (push) Successful in 40s
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 is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user