Save path ./photos/YYYY/YYYY-MM/YYYY-MM-DD/YYYY-MM-DD.fileID.ext; download() from the cache first (closes #143)
check / check (push) Successful in 1m25s
check / check (push) Successful in 1m25s
Originals are saved at `{downloadDirectory}/YYYY/YYYY-MM/YYYY-MM-DD/YYYY-MM-DD.{fileID}{ext}`. The date is the photo's `takenAt` in local time, and `downloadDirectory` defaults to `./photos`, resolved when the library opens. The old `originals/` layout is gone.
`photo.download()` writes the original to `savePath`. It copies from the cache when the cache holds the original, and fetches otherwise. `lib.backup()` uses the same path and rule, and every album in `collections/` links to it. `isLocal` is true only when the original is at `savePath`.
For a file in several albums, one rule picks the copy everything uses: the most recently synced, with the lowest album ID breaking a tie.
Model: opus-5-5
This commit was merged in pull request #146.
This commit is contained in:
@@ -280,6 +280,7 @@ describe("Precache eviction integration", () => {
|
||||
pools: new RequestPools(),
|
||||
source,
|
||||
cacheDirectory: cacheDir,
|
||||
downloadDirectory: join(root, "photos"),
|
||||
getFile: (id) => byID.get(id),
|
||||
statfs,
|
||||
cacheOriginalsMaxBytes: 25, // holds two 10-byte originals
|
||||
@@ -348,6 +349,7 @@ describe("Precache preemption", () => {
|
||||
pools: new RequestPools({ contentConcurrency: 1 }),
|
||||
source,
|
||||
cacheDirectory: join(root, "cache"),
|
||||
downloadDirectory: join(root, "photos"),
|
||||
getFile: (id) => byID.get(id),
|
||||
statfs: async () => ({ bsize: 1, bavail: 1_000_000_000 }),
|
||||
freeBelowBytes: 0,
|
||||
|
||||
Reference in New Issue
Block a user