fix tag count bug if names non-unique, set global as default scope if none entered

This commit is contained in:
Christoph Kluge
2024-09-19 15:21:32 +02:00
parent fe35313305
commit beba7c8d2e
3 changed files with 21 additions and 6 deletions

View File

@@ -133,12 +133,13 @@ func setupTaglistRoute(i InfoType, r *http.Request) InfoType {
return i
}
// Uses tag.ID as second Map-Key component to differentiate tags with identical names
for _, tag := range tags {
tagItem := map[string]interface{}{
"id": tag.ID,
"name": tag.Name,
"scope": tag.Scope,
"count": counts[tag.Name],
"count": counts[fmt.Sprint(tag.Name, tag.ID)],
}
tagMap[tag.Type] = append(tagMap[tag.Type], tagItem)
}