Shares #109
2 changed files with 10 additions and 2 deletions
|
@ -22,6 +22,13 @@ func (d CallDuration) Duration() time.Duration {
|
|||
return time.Duration(d)
|
||||
}
|
||||
|
||||
func (d CallDuration) ColonFormat() string {
|
||||
dur := d.Duration().Round(time.Second)
|
||||
m := dur / time.Minute
|
||||
s := dur / time.Second
|
||||
return fmt.Sprintf("%d:%02d", m, s)
|
||||
}
|
||||
|
||||
func (d CallDuration) MsInt32Ptr() *int32 {
|
||||
if time.Duration(d) == 0 {
|
||||
return nil
|
||||
|
|
|
@ -235,11 +235,12 @@ func (ia *incidentsAPI) getCallsM3U(id ID, w http.ResponseWriter, r *http.Reques
|
|||
|
||||
callUrl.Path = urlRoot + c.ID.String()
|
||||
|
||||
fmt.Fprintf(b, "#EXTINF:%d,%s%s (%s)\n%s\n\n",
|
||||
fmt.Fprintf(b, "#EXTINF:%d,%s%s (%s @ %s)\n%s\n\n",
|
||||
c.Duration.Seconds(),
|
||||
tg.StringTag(true),
|
||||
from,
|
||||
c.DateTime.Format("15:04 01/02"),
|
||||
c.Duration.ColonFormat(),
|
||||
c.DateTime.Format("15:04:05 01/02"),
|
||||
callUrl,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue