1 Commits
Author SHA1 Message Date
sneak ca1c857f7f 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.

Some tests ran `quak files 1` 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
2026-10-26 06:57:40 +00:00
2 changed files with 13 additions and 7 deletions

No files matched your search

+6
View File
@@ -1183,6 +1183,12 @@ 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 precache // Open a library for a single point command. The aggressive background
// (issue #48) is off — a one-shot `collections` or `get` must not start // precache (issue #48) is off, because a one-shot `collections` or `get` must
// downloading the whole account — and no refresh starts as it opens or on a // not start downloading the whole account. No refresh starts as the library
// timer: each command asks for the one it needs. `collections` and `files` // opens or on a timer. Each command asks for the refresh it needs.
// with a collection ID need none (issues #210 and #217). While a refresh runs, // `collections` and `files` with a collection ID need none (issues #210 and
// each collection whose files it has fetched is logged, so a large account // #217). While a refresh runs, each collection whose files it has fetched is
// shows progress rather than nothing. // logged, so a large account 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),