From ee675c4de2b7c35b37877cc616d66290a85a62c9 Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Tue, 17 May 2022 11:16:55 -0400 Subject: [PATCH] Efficiency! --- scripts/play.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/play.php b/scripts/play.php index d86fe34..1e73cbf 100644 --- a/scripts/play.php +++ b/scripts/play.php @@ -220,6 +220,12 @@ if(isset($_GET['species'])){ ?> $iter++; if($config["FULL_DISK"] == "purge") { - if(trim(shell_exec("cat ".$home."/BirdNET-Pi/scripts/disk_check_exclude.txt | grep \"".$filename_formatted."\" | wc -l")) == "0") { + if(!in_array($filename_formatted, $disk_check_exclude_arr)) { $imageicon = "images/unlock.svg"; $title = "This file is not delete protected."; $type = "add"; @@ -314,7 +320,7 @@ if(isset($_GET['filename'])){ $filename_formatted = $date."/".$comname."/".$results['File_Name']; if($config["FULL_DISK"] == "purge") { - if(trim(shell_exec("cat ".$home."/BirdNET-Pi/scripts/disk_check_exclude.txt | grep \"".$filename_formatted."\" | wc -l")) == "0") { + if(!in_array($filename_formatted, $disk_check_exclude_arr)) { $imageicon = "images/unlock.svg"; $title = "This file is not delete protected."; $type = "add";