A person is asked about on every RefreshPeople run: DateLastRefreshed is never stamped #154
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
RefreshPeopleasks a database about the same person on every run, forever.crates/jellyfin-db/src/scan/people.rsgates the sweep on upstream's ownpredicate —
DateLastRefreshed IS NULL OR DateLastRefreshed < ?2— and its docsays both halves matter: "one that was asked about yesterday is not asked again
today however little came back." That half is inert, because nothing ever
stamps the column for a person.
crates/jellyfin-db/src/scan/row.rs:232binds it as(item.saved() && item.kind() != Kind::Person).then(...), which was true whennothing asked about a person: the comment beside it says "a person is created
and saved and never refreshed". #107 made that false.
refresh_people(
crates/jellyfin-server/src/libraries.rs) rebuilds the row and files itthrough the same writer, so the stamp is still NULL and the person qualifies
again on the next run.
Two consequences, and the second is worse than the first:
common for minor crew — is searched for again on every run
ever stamped for them under any fix that only stamps a successful refresh
Upstream stamps it.
PeopleValidationTask's second phase refreshes everyperson to validate them, which is what sets
DateLastRefreshedand is why itsthird phase then asks about nobody — see
reference/README.md.Where to start
The bind is shared by every write, and the two cases want different answers: a
person the scan stands up should keep the null upstream leaves, and one
refresh_peoplefiles should carry the stamp. So the mark belongs on theWriterather than on the kind —jellyfin_core::item::Write::only_createdand its
savedflag are the precedent for how a writer says which kind ofwrite this is.
How to know it is done
A person refreshed once is not in
people_wanting_a_refresh's answer on thenext run, and a person nothing could identify is not either. The second is the
half that needs deciding rather than writing: a row that was never written
cannot carry a stamp.
House rules
CLAUDE.mdis the short version and these are the parts that bite: tests rununder
cargo nextest; upstream's source is the checkout inupstream/at thepin (
v12.0-rc5,6d501ba4) and not the clone beside the repository;generated files are regenerated rather than edited; a comment says what the code
does, not how it got there; and
Dnreferences stay out of code and comments.Landed in
6a774be, with corrections inb5de663.The stamp is bound from the write rather than from the row's kind:
Write::refreshedsays this write went over the row,for_a_nameleaves aperson unrefreshed the way upstream leaves the column null, and a scan standing
one up still writes no stamp.
The half that wanted deciding. Upstream settles it rather than us:
MetadataService.cs:213stamps onhasRefreshedMetadata && hasRefreshedImages,and those go false on a provider that threw — not on one that answered with
nothing. So a name no database knows is a refresh that ran, and an ask that
failed is not.
refreshed_personreturns the two separately instead ofcollapsing both to
None; the people nothing knew are stamped where they standby
mark_people_refreshed, and the ones the ask failed for are left to be askedagain.
Worth knowing: upstream's
PeopleValidatorpassesMetadataRefreshMode.ValidationOnly,so it runs no remote provider for a person at all and always stamps on the first
validation.
Failedhas no upstream analogue — retrying is this port's choice,made because this port does ask.
The review found the fix was half of one. A person's stamp was being
overwritten with null by the next item crediting them: every read of a crediting
item rebuilds their row from the name, which carries no stamp, and the upsert
wrote it. So this was fixed only for a library where nothing is ever re-read —
one new film would send all twenty of its cast back to the sweep. For a person
alone the row now keeps the stamp it has where the write carries none; every
other kind is still written as the row describing it says, which is what lets
#155's folder gate clear one.
Five tests, each checked against the mutation it exists to catch: reverting the
bind, stamping every kind, dropping the person filter, making the stamp a no-op,
and re-reading a crediting item.
What is left is filed as #159 — a cancelled run discards the stamps it earned,
which is the only one of its three that loses work.