From 13e44a72de9f19e6ed008dca71df9fbdbd06cb76 Mon Sep 17 00:00:00 2001 From: frederik Date: Sat, 28 Feb 2026 10:50:26 +0100 Subject: [PATCH] fix: look for an actual json file --- scripts/spectrogram.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/spectrogram.php b/scripts/spectrogram.php index 611e8f6..831f3a9 100644 --- a/scripts/spectrogram.php +++ b/scripts/spectrogram.php @@ -18,9 +18,10 @@ if(isset($_GET['ajax_csv'])) { if (empty($config['RTSP_STREAM'])) { $look_in_directory = $STREAM_DATA_DIR; - $files = scandir($look_in_directory, SCANDIR_SORT_ASCENDING); - //Extract the filename, positions 0 and 1 are the folder hierarchy '.' and '..' - $newest_file = $files[2]; + $files = glob($look_in_directory . "*.wav.json"); + if (count($files) !== 0) { + $newest_file = $files[0]; + } } else { $look_in_directory = $STREAM_DATA_DIR;