downloadAlbums now waits for a refresh from the server through lib.fresh() before walking the albums, so albums and photos added since the cache was last written are downloaded, and a failed refresh throws instead of reporting an empty or stale library as done. The test's stand-in account gains an album holding a new photo before the second run, and that run must download it. The README's "Examples" section says the script opens the library with the thumbnail and originals precache off, as `quak backup` does. Model: opus-5-5
This commit is contained in:
@@ -36,7 +36,10 @@ export async function downloadAlbums(
|
||||
let alreadyLocal = 0;
|
||||
// A photo in several albums is handled once.
|
||||
const done = new Set<number>();
|
||||
for (const album of lib.albums.list()) {
|
||||
// fresh() waits for a refresh from the server and throws if it fails, so
|
||||
// albums and photos added since the cache was last written are included.
|
||||
const { albums } = await lib.fresh();
|
||||
for (const album of albums.list()) {
|
||||
const savePaths: string[] = [];
|
||||
for (const photo of album.photos.list()) {
|
||||
if (!done.has(photo.fileID)) {
|
||||
|
||||
Reference in New Issue
Block a user