mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-28 16:45:32 +00:00
Finalized resolver
This commit is contained in:
@@ -64,14 +64,17 @@ func AgentsView(letterorid string, lib *xmlmodels.Library) *AgentsListView {
|
||||
|
||||
// TODO: We won't need to lock the library if we take down the server during parsing
|
||||
lib.Works.Lock()
|
||||
for _, w := range lib.Works.Array {
|
||||
if ref, ok := w.ReferencesAgent(letterorid); ok {
|
||||
if entry, ok := res.Agents[ref.Ref]; ok {
|
||||
entry.Works = append(entry.Works, WorkByAgent{Work: w, Reference: *ref})
|
||||
res.Agents[ref.Ref] = entry
|
||||
}
|
||||
}
|
||||
}
|
||||
// for _, a := range res.Agents {
|
||||
//
|
||||
// }
|
||||
// for _, w := range lib.Works.Array {
|
||||
// if ref, ok := w.ReferencesAgent(letterorid); ok {
|
||||
// if entry, ok := res.Agents[ref.Ref]; ok {
|
||||
// entry.Works = append(entry.Works, WorkByAgent{Work: w, Reference: *ref})
|
||||
// res.Agents[ref.Ref] = entry
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
lib.Works.Unlock()
|
||||
|
||||
lib.Pieces.Lock()
|
||||
|
||||
@@ -2,7 +2,6 @@ package viewmodels
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"maps"
|
||||
"slices"
|
||||
"sort"
|
||||
@@ -33,7 +32,6 @@ func YearView(year int, lib *xmlmodels.Library) (*YearVM, error) {
|
||||
|
||||
lib.Issues.Lock()
|
||||
for _, issue := range lib.Issues.Array {
|
||||
log.Printf("Issue: %v", issue)
|
||||
y := issue.Datum.When.Year
|
||||
years[y] = true
|
||||
if y == year {
|
||||
|
||||
Reference in New Issue
Block a user