From feec631ca50d42829be6c0d8bbba5bc7f2e21ea7 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 15 Mar 2021 15:02:43 -0400 Subject: [PATCH] Only save updated DiskSpace if event is finished --- web/views/image.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web/views/image.php b/web/views/image.php index 53d91f3b6..2852b3f7b 100644 --- a/web/views/image.php +++ b/web/views/image.php @@ -196,8 +196,10 @@ if ( empty($_REQUEST['path']) ) { Output was: '.implode(PHP_EOL,$output) ); } # Generating an image file will use up more disk space, so update the Event record. - $Event->DiskSpace(null); - $Event->save(); + if ( $Event->EndDateTime() ) { + $Event->DiskSpace(null); + $Event->save(); + } } else { header('HTTP/1.0 404 Not Found'); ZM\Fatal('No snapshot jpg found for event '.$_REQUEST['eid']); @@ -281,8 +283,10 @@ Command was: '.$command.' Output was: '.implode(PHP_EOL,$output) ); } # Generating an image file will use up more disk space, so update the Event record. - $Event->DiskSpace(null); - $Event->save(); + if ( $Event->EndDateTime() ) { + $Event->DiskSpace(null); + $Event->save(); + } } else { header('HTTP/1.0 404 Not Found'); ZM\Fatal("Can't create frame $show images from video because there is no video file for this event at ".