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:
@@ -36,6 +36,7 @@ import {
|
||||
makeAlbumsAPI,
|
||||
makePhotosAPI,
|
||||
makeTimelineAPI,
|
||||
type SavePathLookup,
|
||||
type TimelineGroup,
|
||||
} from "../../src/library/read.js";
|
||||
import { Library } from "../../src/library/index.js";
|
||||
@@ -101,12 +102,19 @@ const file = (
|
||||
};
|
||||
|
||||
// Build the three API objects over one fixed projection, the way `Library`
|
||||
// wires them over its live store.
|
||||
// wires them over its live store. Save paths are covered in
|
||||
// content-library.test.ts; these tests never ask for one.
|
||||
const apis = (records: DerivedRecords) => {
|
||||
const derive = () => records;
|
||||
const saves: SavePathLookup = {
|
||||
savePath: () => {
|
||||
throw new Error("no save paths in these tests");
|
||||
},
|
||||
isLocal: () => false,
|
||||
};
|
||||
return {
|
||||
albums: makeAlbumsAPI(derive),
|
||||
photos: makePhotosAPI(derive),
|
||||
albums: makeAlbumsAPI(derive, saves),
|
||||
photos: makePhotosAPI(derive, saves),
|
||||
timeline: makeTimelineAPI(derive),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user