mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-23 23:08:23 -04:00
If query is empty don't bother parsing it
This commit is contained in:
1 parent
e821553265
commit
f9b5c8a1f4
1 file changed
+6
-1
@@ -132,6 +132,12 @@ sub Sql {
|
||||
my $self = shift;
|
||||
$$self{Sql} = shift if @_;
|
||||
if ( ! $$self{Sql} ) {
|
||||
$self->{Sql} = '';
|
||||
if ( ! $self->{Query} ) {
|
||||
Warning("No query in Filter!");
|
||||
return;
|
||||
}
|
||||
|
||||
my $filter_expr = ZoneMinder::General::jsonDecode($self->{Query});
|
||||
my $sql = 'SELECT E.*,
|
||||
unix_timestamp(E.StartTime) as Time,
|
||||
@@ -142,7 +148,6 @@ sub Sql {
|
||||
INNER JOIN Monitors as M on M.Id = E.MonitorId
|
||||
LEFT JOIN Storage as S on S.Id = E.StorageId
|
||||
';
|
||||
$self->{Sql} = '';
|
||||
|
||||
if ( $filter_expr->{terms} ) {
|
||||
foreach my $term ( @{$filter_expr->{terms}} ) {
|
||||
|
||||
Reference in new issue
Block a user