Clear function to clear things on reparse

This commit is contained in:
Simon Martens
2025-01-07 20:13:08 +01:00
parent f2fd9f9c0a
commit 6cfed94ff6
2 changed files with 8 additions and 4 deletions

View File

@@ -52,11 +52,11 @@ func AgentsView(letterorid string, lib *xmlmodels.Library) *AgentsListView {
}
}
// INFO: All lookups are O(1)
for _, a := range res.Agents {
if works, err := lib.Works.ReverseLookup(a); err == nil {
for _, w := range works {
if pieces, err := lib.Pieces.ReverseLookup(w.Item); err == nil {
// INFO: it makes no sense to append works that have no pieces attached
a.Works = append(a.Works, WorkByAgent{Resolved: w, Pieces: pieces})
}
}