Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10fe0c9841 |
No files matched your search
@@ -887,14 +887,17 @@ own, hashed the same way, and renamed over the original only when it matches; a
|
|||||||
live photo's image and video are both hashed before either is renamed. Until
|
live photo's image and video are both hashed before either is renamed. Until
|
||||||
then the original stays as it was: when the download fails, or what it brings
|
then the original stays as it was: when the download fails, or what it brings
|
||||||
does not match either, the temporary files are deleted, the original keeps its
|
does not match either, the temporary files are deleted, the original keeps its
|
||||||
bytes and its album links, and the file goes into `failures.json`. A file whose
|
bytes and its album links, and the file goes into `failures.json`. A run that
|
||||||
metadata records no hash is left as it is and counted as unchecked. A stored
|
stops between renaming a live photo's new image and its new video leaves the new
|
||||||
original that cannot be read is left as it is and counts as failed. The summary
|
image beside the old video, which a later `--verify` run replaces if the video
|
||||||
and `--json` add the counts `verified`, `mismatched` and `unchecked`, all of
|
was the part that did not match. A file whose metadata records no hash is left
|
||||||
originals that were already stored; one first downloaded in this run is in none
|
as it is and counted as unchecked. A stored original that cannot be read is left
|
||||||
of them. A mismatch that was replaced with matching bytes does not make the exit
|
as it is and counts as failed. The summary and `--json` add the counts
|
||||||
code non-zero. Without `--verify` nothing is hashed, the summary is unchanged,
|
`verified`, `mismatched` and `unchecked`, all of originals that were already
|
||||||
and the three counts are 0 in `--json`.
|
stored; one first downloaded in this run is in none of them. A mismatch that was
|
||||||
|
replaced with matching bytes does not make the exit code non-zero. Without
|
||||||
|
`--verify` nothing is hashed, the summary is unchanged, and the three counts are
|
||||||
|
0 in `--json`.
|
||||||
|
|
||||||
Each original is written to a temporary file in the same directory, synced to
|
Each original is written to a temporary file in the same directory, synced to
|
||||||
disk, and renamed into place, so an original is either complete or absent, even
|
disk, and renamed into place, so an original is either complete or absent, even
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
// originals, the thumbnail pool for thumbnails. The pool limits concurrency,
|
// originals, the thumbnail pool for thumbnails. The pool limits concurrency,
|
||||||
// orders on-demand work ahead of background, and dedups by key so a fileID
|
// orders on-demand work ahead of background, and dedups by key so a fileID
|
||||||
// requested twice while the first is still in flight downloads once.
|
// requested twice while the first is still in flight downloads once.
|
||||||
|
// `fetchOriginal` passes no key, so it is not shared with a fetch of the same
|
||||||
|
// file already in flight.
|
||||||
//
|
//
|
||||||
// Integrity. The reused streaming decrypt is the enforced guarantee: every
|
// Integrity. The reused streaming decrypt is the enforced guarantee: every
|
||||||
// chunk is authenticated and the writer renames the file into place only once
|
// chunk is authenticated and the writer renames the file into place only once
|
||||||
@@ -439,10 +441,11 @@ export const placeOriginal = async (
|
|||||||
// copy there, a live photo as its image and its video beside that file, each
|
// copy there, a live photo as its image and its video beside that file, each
|
||||||
// with its own extension. Only a copy that matches is renamed over the stored
|
// with its own extension. Only a copy that matches is renamed over the stored
|
||||||
// one, and a live photo's image and video are both hashed before either is
|
// one, and a live photo's image and video are both hashed before either is
|
||||||
// renamed. Two renames cannot happen at once: should the video's fail, the
|
// renamed. The image is renamed first: should the run stop, or the video's
|
||||||
// image is already the new one, and the next backup with `verify` finds that
|
// rename fail, before the video is renamed, the new image is left beside the
|
||||||
// the two do not match. When `get` fails or the copy does not match, the
|
// old video, and a later backup with `verify` replaces the video if the video
|
||||||
// temporary files are removed and the stored original stays as it was.
|
// was the part that did not match. When `get` fails or the copy does not match,
|
||||||
|
// the temporary files are removed and the stored original stays as it was.
|
||||||
export const replaceOriginal = async (
|
export const replaceOriginal = async (
|
||||||
root: string,
|
root: string,
|
||||||
file: EnteFile,
|
file: EnteFile,
|
||||||
|
|||||||
Reference in new issue
Block a user