Smal correction

This commit is contained in:
Simon Martens
2025-01-02 00:34:37 +01:00
parent 3f294680c0
commit 4f2649cd8b
2 changed files with 7 additions and 3 deletions

View File

@@ -95,9 +95,9 @@ func (p *XMLProvider[T]) Serialize(dataholder XMLRootElement[T], path string, la
// INFO: If the item has a GetReferences method, we add the references to the resolver. // INFO: If the item has a GetReferences method, we add the references to the resolver.
if refResolver, ok := any(item).(ReferenceResolver); ok { if refResolver, ok := any(item).(ReferenceResolver); ok {
for refType, ids := range refResolver.GetReferences() { for name, ids := range refResolver.GetReferences() {
for _, refID := range ids { for _, id := range ids {
p.Resolver.Add(refType, refID, &item) p.Resolver.Add(name, id, &item)
} }
} }
} }

View File

@@ -2,6 +2,7 @@ package viewmodels
import ( import (
"fmt" "fmt"
"log"
"maps" "maps"
"slices" "slices"
"sort" "sort"
@@ -33,6 +34,9 @@ func YearView(year int, lib *xmlmodels.Library) (*YearVM, error) {
lib.Issues.Lock() lib.Issues.Lock()
for _, issue := range lib.Issues.Array { for _, issue := range lib.Issues.Array {
y := issue.Datum.When.Year y := issue.Datum.When.Year
if y == 0 {
log.Println("Issue has no year: ", issue.String())
}
years[y] = true years[y] = true
if y == year { if y == year {
functions.MapArrayInsert(issues, issue.Datum.When.Month, issue) functions.MapArrayInsert(issues, issue.Datum.When.Month, issue)