From e256d9a5a8a2f2aca6307193fb03058991d0fffc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 23 Apr 2021 14:50:48 -0400 Subject: [PATCH] Use ZoneMinder::Monitor->find_one instead of zmDbGetMonitor so that we get an object with useful methods --- scripts/ZoneMinder/lib/ZoneMinder/Control.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control.pm index acce8eb4a..feb12a0ca 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control.pm @@ -29,6 +29,7 @@ use strict; use warnings; require ZoneMinder::Base; +require ZoneMinder::Monitor; our $VERSION = $ZoneMinder::Base::VERSION; @@ -95,8 +96,8 @@ sub close { sub loadMonitor { my $self = shift; if ( !$self->{Monitor} ) { - if ( !($self->{Monitor} = zmDbGetMonitor($self->{id})) ) { - Fatal('Monitor id '.$self->{id}.' not found or not controllable'); + if ( !($self->{Monitor} = ZoneMinder::Monitor->find_one(Id=>$self->{id})) ) { + Fatal('Monitor id '.$self->{id}.' not found'); } if ( defined($self->{Monitor}->{AutoStopTimeout}) ) { # Convert to microseconds.