1 Commits
Author SHA1 Message Date
sneak 3c6dfc9487 quak files COLLECTION fetches that collection's files alone (closes #217)
check / check (push) Canceled after 0s
`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.
`quak files` without a collection ID still waits for a refresh.

Tests that ran `quak files 1` to fill the cache, to show a refresh's
progress or to show what `-q` hides now run a command that still
refreshes.

Model: opus-5-5
2026-10-26 06:37:43 +00:00
2 changed files with 7 additions and 13 deletions

No files matched your search

-6
View File
@@ -1183,12 +1183,6 @@ since the stored copy, so a collection stored without its files would never get
them. `quak collections` uses it (issue them. `quak collections` uses it (issue
https://git.eeqj.de/sneak/quak/issues/210). https://git.eeqj.de/sneak/quak/issues/210).
`await lib.freshFiles(collection)` is the fresh read of one collection's files.
It answers with every live file in that collection that decrypts, in the
server's order. `collection` is a record that `freshCollections()` returned. The
method fetches no other collection's files and stores nothing. `quak files` with
a collection ID uses it.
An album or file in the server's answer that quak cannot decrypt, or whose An album or file in the server's answer that quak cannot decrypt, or whose
metadata is not JSON, does not fail the refresh. The refresh leaves it out, an metadata is not JSON, does not fail the refresh. The refresh leaves it out, an
album with all its files, and drops any older copy the cache held, so reads album with all its files, and drops any older copy the cache held, so reads
+7 -7
View File
@@ -128,13 +128,13 @@ const readLibraryClient = (client: Client): LibraryClient => ({
contentSource: () => client.contentSource(), contentSource: () => client.contentSource(),
}); });
// Open a library for a single point command. The aggressive background // Open a library for a single point command: the aggressive background precache
// precache (issue #48) is off, because a one-shot `collections` or `get` must // (issue #48) is off — a one-shot `collections` or `get` must not start
// not start downloading the whole account. No refresh starts as the library // downloading the whole account — and no refresh starts as it opens or on a
// opens or on a timer. Each command asks for the refresh it needs. // timer: each command asks for the one it needs. `collections` and `files`
// `collections` and `files` with a collection ID need none (issues #210 and // with a collection ID need none (issues #210 and #217). While a refresh runs,
// #217). While a refresh runs, each collection whose files it has fetched is // each collection whose files it has fetched is logged, so a large account
// logged, so a large account shows progress rather than nothing. // shows progress rather than nothing.
const openReadLibrary = (ctx: CliContext, client: Client): Promise<Library> => const openReadLibrary = (ctx: CliContext, client: Client): Promise<Library> =>
Library.open({ Library.open({
client: readLibraryClient(client), client: readLibraryClient(client),