quak get and get-thumb on an empty cache stop fetching collections once they find the file (closes #222)
check / check (push) Waiting to run

`quak get` and `quak get-thumb` used to wait for a refresh, which on an
empty cache fetched the files of every collection. Now, on an empty
cache, `freshFile` reads the collection list, then one collection's
files at a time, and stops at the first that holds the file. That search
stores nothing. Once the cache holds the account's collections,
`freshFile` refreshes as before and looks the file up in the cache. The
commands fetch the content through the new `Library.originalOf()` and
`Library.thumbnailOf()`, which take the file record itself, since the
store may not hold it.

On an empty cache they no longer print a refresh's progress lines. The
`-q` test that relied on `get` refreshing now runs
`helper fix-missing-thumbnails`.

Model: opus-5-5
This commit was merged in pull request #226.
This commit is contained in:
2026-10-26 10:18:28 +01:00
parent af1491966c
commit f65c237e2c
11 changed files with 278 additions and 109 deletions
+5 -3
View File
@@ -234,13 +234,15 @@ describe("-q", () => {
});
});
// The refresh's progress is left out; the line saying why the command
// No album holds file 999, so fixing it fails. The refresh's progress and
// the list of failed files are left out. The line saying why the command
// failed is the fatal one, and it is printed.
it("prints only the line a failing command exits with", async () => {
expect(await quak("-q", "get", "999")).toEqual({
const fix = ["helper", "fix-missing-thumbnails", "--file", "999"];
expect(await quak("-q", ...fix)).toEqual({
code: 1,
stdout: "",
stderr: "File 999 not found\n",
stderr: `quak: 1 file(s) failed; see the "Failed files:" list, or the JSON with --json\n`,
});
});