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