From e7e823beceecc4982bb162a1546bc760e74ee4b9 Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Fri, 20 May 2022 09:42:56 -0400 Subject: [PATCH] Much better Best Recordings > disk_check_exclude.txt logic --- scripts/stats.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/stats.php b/scripts/stats.php index fce469b..3987187 100644 --- a/scripts/stats.php +++ b/scripts/stats.php @@ -59,15 +59,6 @@ $home = trim($home); if(!file_exists($home."/BirdNET-Pi/scripts/disk_check_exclude.txt")) { file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "##start\n##end"); } -function editfile( $sourcefile, $start='##start', $end='##end', $data=array() ){ - $lines=array_filter( file( $sourcefile , FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES ) ); - $output=array_merge( - array_splice( $lines, 0, array_search( strtolower( $start ), array_map('strtolower', $lines ) ) + 1 ), - $data, - array_splice( $lines, array_search( strtolower( $end ), array_map('strtolower', $lines ) ) ) - ); - file_put_contents( $sourcefile, implode( PHP_EOL, $output ) ); -} ?> @@ -210,8 +201,10 @@ array_push($excludelines, $results['Date']."/".$comname."/".$results['File_Name' Best Recording: