fix: look for an actual json file
This commit is contained in:
@@ -18,9 +18,10 @@ if(isset($_GET['ajax_csv'])) {
|
|||||||
|
|
||||||
if (empty($config['RTSP_STREAM'])) {
|
if (empty($config['RTSP_STREAM'])) {
|
||||||
$look_in_directory = $STREAM_DATA_DIR;
|
$look_in_directory = $STREAM_DATA_DIR;
|
||||||
$files = scandir($look_in_directory, SCANDIR_SORT_ASCENDING);
|
$files = glob($look_in_directory . "*.wav.json");
|
||||||
//Extract the filename, positions 0 and 1 are the folder hierarchy '.' and '..'
|
if (count($files) !== 0) {
|
||||||
$newest_file = $files[2];
|
$newest_file = $files[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$look_in_directory = $STREAM_DATA_DIR;
|
$look_in_directory = $STREAM_DATA_DIR;
|
||||||
|
|||||||
Reference in New Issue
Block a user