Shares #109

Merged
amigan merged 59 commits from shareUI into trunk 2025-02-14 00:25:03 -05:00
4 changed files with 9 additions and 0 deletions
Showing only changes of commit 632607cd0b - Show all commits

View file

@ -97,6 +97,10 @@ func (c *Call) ShouldStore() bool {
}
func (c *Call) SetShareURL(baseURL url.URL, shareID string) {
if c.AudioURL != nil {
return
}
baseURL.Path = fmt.Sprintf("/share/%s/call", shareID)
c.AudioURL = common.PtrTo(baseURL.String())
}

View file

@ -74,6 +74,7 @@ func toAddCallParams(call *calls.Call) database.AddCallParams {
AudioName: common.NilIfZero(call.AudioName),
AudioBlob: call.Audio,
AudioType: common.NilIfZero(call.AudioType),
AudioUrl: call.AudioURL,
Duration: call.Duration.MsInt32Ptr(),
Frequency: call.Frequency,
Frequencies: call.Frequencies,

View file

@ -29,6 +29,9 @@ type Incident struct {
func (inc *Incident) SetShareURL(bu url.URL, shareID string) {
bu.Path = fmt.Sprintf("/share/%s/call/", shareID)
for i := range inc.Calls {
if inc.Calls[i].AudioURL != nil {
continue
}
inc.Calls[i].AudioURL = common.PtrTo(bu.String() + inc.Calls[i].ID.String())
}
}

View file

@ -268,6 +268,7 @@ func fromDBCalls(d []database.GetIncidentCallsRow) []incidents.IncidentCall {
ID: v.CallID,
AudioName: common.ZeroIfNil(v.AudioName),
AudioType: common.ZeroIfNil(v.AudioType),
AudioURL: v.AudioUrl,
Duration: dur,
DateTime: v.CallDate.Time,
Frequencies: v.Frequencies,