REST and other improvements #27

Merged
amigan merged 6 commits from rest into trunk 2024-11-06 20:50:41 -05:00
2 changed files with 4 additions and 7 deletions
Showing only changes of commit 65cddbcc0d - Show all commits

View file

@ -169,11 +169,8 @@ func (as *alerter) eval(ctx context.Context, now time.Time, testMode bool) ([]Al
for _, s := range as.scores {
origScore := s.Score
tgr, err := as.tgCache.TG(ctx, s.ID)
if err == nil {
if !tgr.Talkgroup.Alert {
continue
}
s.Score *= float64(tgr.Talkgroup.Weight)
if err == nil && !tgr.Talkgroup.Alert {
continue
}
if s.Score > as.cfg.AlertThreshold || testMode {

View file

@ -13,8 +13,8 @@ type Talkgroup struct {
}
type ID struct {
System uint32
Talkgroup uint32
System uint32 `json:"sys"`
Talkgroup uint32 `json:"tg"`
}
type IDs []ID