diff --git a/stream.go b/stream.go index eac96e4..28ba4ba 100755 --- a/stream.go +++ b/stream.go @@ -19,7 +19,6 @@ import ( type Stream struct { Name string `json:"name"` URL string `json:"url"` - Base64 string `json:"base64"` Interval int `json:"interval"` MotionInterval int `json:"motionInterval"` WatchAreas []WatchArea `json:"watchAreas"` @@ -29,12 +28,10 @@ type Stream struct { // NewStream creates a new Stream Object func NewStream(Name string, URL string, Interval int, MotionInterval int) *Stream { - base64 := URLToBase64(URL) stream := Stream{ Name: Name, URL: URL, - Base64: base64, Interval: Interval, MotionInterval: MotionInterval, WatchAreas: make([]WatchArea, 0), @@ -200,12 +197,12 @@ func (s *Stream) WriteStreamJSON() { _ = ioutil.WriteFile(s.GetStreamJSONPath(), file, 0644) } -// GetStreamStoreDirPath returns filepath.Join(s.GetStreamDirPath(), s.Base64) +// GetStreamStoreDirPath returns filepath.Join(s.GetStreamDirPath(), s.Name) func (s *Stream) GetStreamStoreDirPath() string { return filepath.Join(GetStreamDirPath(), s.Name) } -// GetPreviousInstantPath returns filepath.Join(GetStreamDirPath(), s.Base64, "previous.jpg") +// GetPreviousInstantPath returns filepath.Join(GetStreamStoreDirPath(), "previous.jpg") func (s *Stream) GetPreviousInstantPath() string { return filepath.Join(s.GetStreamStoreDirPath(), "previous.jpg") } @@ -225,7 +222,7 @@ func (s *Stream) IMReadPrevious() gocv.Mat { return gocv.IMRead(s.GetPreviousInstantPath(), gocv.IMReadGrayScale) } -// GetCurrentInstantPath returns filepath.Join(s.GetStreamDirPath(), s.Base64, "current.jpg") +// GetCurrentInstantPath returns filepath.Join(s.GetStreamStoreDirPath(), "current.jpg") func (s *Stream) GetCurrentInstantPath() string { return filepath.Join(s.GetStreamStoreDirPath(), "current.jpg") } @@ -245,7 +242,7 @@ func (s *Stream) IMReadCurrent() gocv.Mat { return gocv.IMRead(s.GetCurrentInstantPath(), gocv.IMReadGrayScale) } -// GetCurrentColorInstantPath returns filepath.Join(s.GetStreamDirPath(), s.Base64, "current_color.jpg") +// GetCurrentColorInstantPath returns filepath.Join(s.GetStreamStoreDirPath(), "current_color.jpg") func (s *Stream) GetCurrentColorInstantPath() string { return filepath.Join(s.GetStreamStoreDirPath(), "current_color.jpg") } @@ -265,7 +262,7 @@ func (s *Stream) IMReadCurrentColor() gocv.Mat { return gocv.IMRead(s.GetCurrentColorInstantPath(), gocv.IMReadColor) } -// GetNextInstantPath returns filepath.Join(s.GetStreamDirPath(), s.Base64, "last.jpg") +// GetNextInstantPath returns filepath.Join(s.GetStreamStoreDirPath(), "last.jpg") func (s *Stream) GetNextInstantPath() string { return filepath.Join(s.GetStreamStoreDirPath(), "last.jpg") } @@ -285,7 +282,7 @@ func (s *Stream) IMReadNext() gocv.Mat { return gocv.IMRead(s.GetNextInstantPath(), gocv.IMReadGrayScale) } -// GetDebugInstantPath returns filepath.Join(s.GetStreamDirPath(), s.Base64, "debug.jpg") +// GetDebugInstantPath returns filepath.Join(s.GetStreamStoreDirPath(), "debug.jpg") func (s *Stream) GetDebugInstantPath() string { return filepath.Join(s.GetStreamStoreDirPath(), "debug.jpg") }