mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-27 00:38:30 -04:00
Use ZoneMinder::Monitor->find_one instead of zmDbGetMonitor so that we get an object with useful methods
This commit is contained in:
1 parent
36ac473ad2
commit
e256d9a5a8
1 file changed
+3
-2
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user