Shares #109

Merged
amigan merged 59 commits from shareUI into trunk 2025-02-14 00:25:03 -05:00
2 changed files with 10 additions and 2 deletions
Showing only changes of commit 24c66e7c87 - Show all commits

View file

@ -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

View file

@ -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,
)
}