From 28b85e1977bbe50966221f558d8ad1b622c04286 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 18 Apr 2018 13:48:20 -0700 Subject: [PATCH] Add ZeroSize test to Event Audit Report --- web/skins/classic/views/report_event_audit.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/views/report_event_audit.php b/web/skins/classic/views/report_event_audit.php index e779d3bdf..4da7b032c 100644 --- a/web/skins/classic/views/report_event_audit.php +++ b/web/skins/classic/views/report_event_audit.php @@ -98,7 +98,7 @@ $EventsByMonitor = array(); while( $event = $result->fetch(PDO::FETCH_ASSOC) ) { $Event = new Event($event); if ( ! isset($EventsByMonitor[$event['MonitorId']]) ) - $EventsByMonitor[$event['MonitorId']] = array( 'Events'=>array(), 'MinGap'=>0, 'MaxGap'=>0, 'FileMissing'=>0, ); + $EventsByMonitor[$event['MonitorId']] = array( 'Events'=>array(), 'MinGap'=>0, 'MaxGap'=>0, 'FileMissing'=>0, 'ZeroSize'=>0 ); if ( count($EventsByMonitor[$event['MonitorId']]['Events']) ) { $last_event = end($EventsByMonitor[$event['MonitorId']]['Events']); @@ -112,6 +112,8 @@ while( $event = $result->fetch(PDO::FETCH_ASSOC) ) { } # end if has previous events if ( ! file_exists( $Event->Path().'/'.$Event->DefaultVideo() ) ) { $EventsByMonitor[$event['MonitorId']]['FileMissing'] += 1; + } else if ( ! filesize( $Event->Path().'/'.$Event->DefaultVideo() ) ) { + $EventsByMonitor[$event['MonitorId']]['ZeroSize'] += 1; } $EventsByMonitor[$event['MonitorId']]['Events'][] = $Event; } # end foreach event @@ -142,6 +144,7 @@ while( $event = $result->fetch(PDO::FETCH_ASSOC) ) { + @@ -169,6 +172,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) { Id()])?$EventsByMonitor[$Monitor->Id()]['MinGap']:0 ?> Id()])?$EventsByMonitor[$Monitor->Id()]['MaxGap']:0 ?> Id()])?$EventsByMonitor[$Monitor->Id()]['FileMissing']:0 ?> + Id()])?$EventsByMonitor[$Monitor->Id()]['ZeroSize']:0 ?>