This commit is contained in:
Daniel Ponte 2025-02-22 18:00:09 -05:00
parent fb18abe685
commit 8d36b8dfef
3 changed files with 17 additions and 3 deletions

View file

@ -91,7 +91,17 @@ func (c *Call) GetResourceName() string {
}
func (c *Call) String() string {
return fmt.Sprintf("%s to %d from %d", c.AudioName, c.Talkgroup, c.Source)
var from string
switch {
case c.Source != 0 && c.TalkerAlias != nil:
from = fmt.Sprintf(" from %s (%d)", *c.TalkerAlias, c.Source)
case c.Source != 0:
from = fmt.Sprintf(" from %d", c.Source)
case c.TalkerAlias != nil:
from = fmt.Sprintf(" from %s", *c.TalkerAlias)
}
return fmt.Sprintf("%s to %d%s", c.AudioName, c.Talkgroup, from)
}
func (c *Call) ShouldStore() bool {

View file

@ -229,8 +229,13 @@ func (ia *incidentsAPI) getCallsM3U(id ID, w http.ResponseWriter, r *http.Reques
return
}
var from string
if c.Source != 0 {
switch {
case c.Source != 0 && c.TalkerAlias != nil:
from = fmt.Sprintf(" from %s (%d)", *c.TalkerAlias, c.Source)
case c.Source != 0:
from = fmt.Sprintf(" from %d", c.Source)
case c.TalkerAlias != nil:
from = fmt.Sprintf(" from %s", *c.TalkerAlias)
}
callUrl.Path = urlRoot + c.ID.String()

View file

@ -10,7 +10,6 @@ import (
"dynatron.me/x/stillbox/pkg/calls"
"dynatron.me/x/stillbox/pkg/calls/callstore"
"dynatron.me/x/stillbox/pkg/services"
"github.com/rs/zerolog/log"
)
const DefaultExpiration = 5 * time.Minute