Abschluss Personen & Startseite. Viele BUGFIXes

This commit is contained in:
Simon Martens
2025-02-28 16:54:49 +01:00
parent db8c08a0fc
commit 4581f34dd9
132 changed files with 333 additions and 86 deletions

View File

@@ -2,6 +2,8 @@ package pages
import (
"database/sql"
"maps"
"slices"
"github.com/Theodor-Springmann-Stiftung/musenalm/app"
"github.com/Theodor-Springmann-Stiftung/musenalm/dbmodels"
@@ -194,10 +196,15 @@ func (p *AgentResult) FilterContentsByEntry(app core.App, id string, res *AgentR
}
res.Contents = contentMap
for _, c := range contentMap {
dbmodels.Sort_Contents_Numbering(c)
}
entries, err := dbmodels.Entries_IDs(app, entrykeys)
if err != nil {
return err
}
dbmodels.Sort_Entries_Year_Title(entries)
res.CResult = entries
return nil
@@ -212,5 +219,24 @@ func (p *AgentResult) LenSeries() int {
}
func (p *AgentResult) LenContents() int {
return len(p.Contents)
i := 0
for _, c := range p.Contents {
i += len(c)
}
return i
}
func (p *AgentResult) Types() []string {
types := make(map[string]bool)
// INFO: this is just a handful of entries usuallly so we're fine
for _, c := range p.Contents {
for _, c := range c {
for _, c := range c.MusenalmType() {
types[c] = true
}
}
}
return slices.Collect(maps.Keys(types))
}