Closes #120
This commit is contained in:
parent
fb18abe685
commit
8d36b8dfef
3 changed files with 17 additions and 3 deletions
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue