quak files COLLECTION fetches that collection's files alone (closes #217)
check / check (push) Waiting to run

`quak files` with a collection ID used to wait for a full refresh, which
on an empty cache fetched the files of every collection in the account.
It now reads the collection list, then that one collection's files
through the new `Library.freshFiles()`, and stores nothing. The files
print in the server's order, and no refresh progress lines appear. Each
file prints once, as the latest copy the server sent. `quak files`
without a collection ID still waits for a refresh.

Some tests ran `quak files` with a collection ID to fill the cache, to
show a refresh's progress or to show what `-q` hides. They now run a
command that still refreshes.

Model: opus-5-5
This commit was merged in pull request #225.
This commit is contained in:
2026-10-26 09:04:39 +01:00
parent 657266a60e
commit af1491966c
8 changed files with 282 additions and 147 deletions
+12 -11
View File
@@ -128,12 +128,13 @@ const readLibraryClient = (client: Client): LibraryClient => ({
contentSource: () => client.contentSource(),
});
// Open a library for a single point command: the aggressive background precache
// (issue #48) is off — a one-shot `collections` or `get` must not start
// downloading the whole account — and no refresh starts as it opens or on a
// timer: each command asks for the one it needs, and `collections` needs none
// (issue #210). While a refresh runs, each collection whose files it has
// fetched is logged, so a large account shows progress rather than nothing.
// Open a library for a single point command. The aggressive background
// precache (issue #48) is off, because a one-shot `collections` or `get` must
// not start downloading the whole account. No refresh starts as the library
// opens or on a timer. Each command asks for the refresh it needs.
// `collections` and `files` with a collection ID need none (issues #210 and
// #217). While a refresh runs, each collection whose files it has fetched is
// logged, so a large account shows progress rather than nothing.
const openReadLibrary = (ctx: CliContext, client: Client): Promise<Library> =>
Library.open({
client: readLibraryClient(client),
@@ -282,11 +283,11 @@ export const filesCommand = async (
const lib = await openReadLibrary(ctx, client);
try {
// Force a server round-trip and list in enumeration order (issue #36
// amendment, issue #52). Each file prints from its own decrypted
// metadata (raw title, microsecond creationTime) via cli-output, and in
// the pre-library CLI's enumeration order, not the projection's
// newest-first order.
// Ask the server for current state (issue #36 amendment, issue #52).
// Each file prints from its own decrypted metadata (raw title,
// microsecond creationTime) via cli-output. The files print in the
// order `freshFiles` returns them, not the projection's newest-first
// order.
const files = await freshFiles(lib, collectionID);
if (!files) {
ctx.log("fatal", `Collection ${collectionID} not found`);