quak helper fix-missing-thumbnails --file on an empty cache stops fetching collections once it finds every file (closes #223)
check / check (push) Waiting to run

`helper fix-missing-thumbnails --file` used to wait for a refresh, which
on an empty cache fetched the files of every collection. It now finds the
named files through the new `freshFilesByID` in `src/cli-read.ts`, by the
rule `freshFile` follows. On an empty cache it reads the collection list,
then one collection's files at a time, and stores none of the collections
or file records it reads. It searches the most recently updated
collection first. So a file in several albums is still named after the
first of them that `Library.albums.list()` lists. `fixMissingThumbnails`
now takes the records the command found, and fetches each original
through `lib.originalOf()`.

Model: opus-5-5
This commit was merged in pull request #227.
This commit is contained in:
2026-10-26 11:25:10 +01:00
parent f65c237e2c
commit a1ea47f9a8
9 changed files with 322 additions and 70 deletions
+11 -9
View File
@@ -689,14 +689,15 @@ request, and neither fetches any collection's files nor changes the cache.
`files` with a collection ID asks for the same list, then for that one
collection's files, and does not change the cache either. On an empty cache,
`get` and `get-thumb` ask for the same list, then for one collection's files at
a time, until they find the file. They store none of the collections or file
records they read. The original or thumbnail they fetch is kept in the cache.
Once the cache holds the account's collections, they wait for a refresh instead.
The others wait for a refresh, and so does `files` without a collection ID. With
an empty cache, as on a first run, that refresh fetches the files of every
collection, one collection after another, and stores nothing until it has them
all, which on a large account takes a while. Meanwhile the command logs a line
on stderr for each collection whose files it has fetched, such as
a time, until they find the file. `helper fix-missing-thumbnails --file` does
the same until it finds every file it names. They store none of the collections
or file records they read. The original or thumbnail they fetch is kept in the
cache. Once the cache holds the account's collections, they wait for a refresh
instead. The others wait for a refresh, and so does `files` without a collection
ID. With an empty cache, as on a first run, that refresh fetches the files of
every collection, one collection after another, and stores nothing until it has
them all, which on a large account takes a while. Meanwhile the command logs a
line on stderr for each collection whose files it has fetched, such as
`Fetched the files of 3 of 120 collections`, with `--json` too; `backup` does
the same while the refresh it starts with runs. stdout holds only the command's
output. If that round-trip fails, the command prints the error on one line and
@@ -1192,7 +1193,8 @@ 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, and so do `quak get` and `quak get-thumb` on an empty
cache.
cache. `quak helper fix-missing-thumbnails --file` uses it on an empty cache
too.
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