This commit is contained in:
2026-04-22 23:35:59 +01:00
parent df6c33bc3a
commit bee7869af4
116 changed files with 13552 additions and 0 deletions

60
server/models/streams.go Normal file
View File

@@ -0,0 +1,60 @@
package models
import "github.com/pocketbase/pocketbase/core"
const (
StreamFCamera = "camera"
)
type Stream struct {
core.BaseRecordProxy
}
func (s *Stream) CameraID() string {
return s.GetString(StreamFCamera)
}
func (s *Stream) SetCameraID(id string) {
s.Set("camera", id)
}
func (s *Stream) Camera() *Camera {
if r := s.ExpandedOne(StreamFCamera); r != nil {
camera := &Camera{}
camera.SetProxyRecord(r)
return camera
}
return nil
}
func (s *Stream) URL() string {
return s.GetString("url")
}
func (s *Stream) SetURL(url string) {
s.Set("url", url)
}
func (s *Stream) FPS() float64 {
return s.GetFloat("fps")
}
func (s *Stream) SetFPS(fps float64) {
s.Set("fps", fps)
}
func (s *Stream) Height() int {
return s.GetInt("height")
}
func (s *Stream) SetHeight(height int) {
s.Set("height", height)
}
func (s *Stream) Width() int {
return s.GetInt("width")
}
func (s *Stream) SetWidth(width int) {
s.Set("width", width)
}