Rename meta to metadata

This commit is contained in:
Eran Gonen 2025-11-27 09:12:20 +02:00
parent bbaf4b1eaf
commit a4dbcad00b
4 changed files with 30 additions and 30 deletions

View file

@ -619,9 +619,9 @@ func (a *API) onPathsCameras(ctx *gin.Context) {
cameraItem := map[string]any{
"name": item.Name,
}
if item.Meta != nil {
// Merge meta fields at the same level as name
for k, v := range item.Meta {
if item.Metadata != nil {
// Merge metadata fields at the same level as name
for k, v := range item.Metadata {
cameraItem[k] = v
}
}

View file

@ -112,18 +112,18 @@ type Path struct {
Name string `json:"name"` // filled by Check()
// General
Source string `json:"source"`
SourceFingerprint string `json:"sourceFingerprint"`
SourceOnDemand bool `json:"sourceOnDemand"`
SourceOnDemandStartTimeout Duration `json:"sourceOnDemandStartTimeout"`
SourceOnDemandCloseAfter Duration `json:"sourceOnDemandCloseAfter"`
MaxReaders int `json:"maxReaders"`
SRTReadPassphrase string `json:"srtReadPassphrase"`
Fallback string `json:"fallback"`
UseAbsoluteTimestamp bool `json:"useAbsoluteTimestamp"`
CalcBitrateWindow Duration `json:"calcBitrateWindow"`
DropNonKeyframes bool `json:"dropNonKeyframes"`
Meta map[string]any `json:"meta" yaml:"meta"`
Source string `json:"source"`
SourceFingerprint string `json:"sourceFingerprint"`
SourceOnDemand bool `json:"sourceOnDemand"`
SourceOnDemandStartTimeout Duration `json:"sourceOnDemandStartTimeout"`
SourceOnDemandCloseAfter Duration `json:"sourceOnDemandCloseAfter"`
MaxReaders int `json:"maxReaders"`
SRTReadPassphrase string `json:"srtReadPassphrase"`
Fallback string `json:"fallback"`
UseAbsoluteTimestamp bool `json:"useAbsoluteTimestamp"`
CalcBitrateWindow Duration `json:"calcBitrateWindow"`
DropNonKeyframes bool `json:"dropNonKeyframes"`
Metadata map[string]any `json:"metadata" yaml:"metadata"`
// Record
Record bool `json:"record"`

View file

@ -642,7 +642,7 @@ func (pa *path) doAPIPathsGet(req pathAPIPathsGetReq) {
}
return ret
}(),
BitrateReceived: bitrateReceived,
BitrateReceived: bitrateReceived,
LastRTPTimestamp: func() *int64 {
if !pa.isReady() {
return nil
@ -653,7 +653,7 @@ func (pa *path) doAPIPathsGet(req pathAPIPathsGetReq) {
}
return &ts
}(),
Meta: pa.conf.Meta,
Metadata: pa.conf.Metadata,
},
}
}

View file

@ -76,18 +76,18 @@ type APIPathSourceOrReader struct {
// APIPath is a path.
type APIPath struct {
Name string `json:"name"`
ConfName string `json:"confName"`
Source *APIPathSourceOrReader `json:"source"`
Ready bool `json:"ready"`
ReadyTime *time.Time `json:"readyTime"`
Tracks []string `json:"tracks"`
BytesReceived uint64 `json:"bytesReceived"`
BytesSent uint64 `json:"bytesSent"`
Readers []APIPathSourceOrReader `json:"readers"`
BitrateReceived float64 `json:"bitrateReceived"`
LastRTPTimestamp *int64 `json:"lastRTPTimestamp"`
Meta map[string]any `json:"meta,omitempty"`
Name string `json:"name"`
ConfName string `json:"confName"`
Source *APIPathSourceOrReader `json:"source"`
Ready bool `json:"ready"`
ReadyTime *time.Time `json:"readyTime"`
Tracks []string `json:"tracks"`
BytesReceived uint64 `json:"bytesReceived"`
BytesSent uint64 `json:"bytesSent"`
Readers []APIPathSourceOrReader `json:"readers"`
BitrateReceived float64 `json:"bitrateReceived"`
LastRTPTimestamp *int64 `json:"lastRTPTimestamp"`
Metadata map[string]any `json:"metadata,omitempty"`
}
// APIPathList is a list of paths.