Update to return IdentifiedSoFar.txt - IDFILE location
This commit is contained in:
@@ -1103,6 +1103,8 @@ function getDirectory($dir)
|
||||
*/
|
||||
function getFilePath($filename)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if ($filename == "analyzing_now.txt") {
|
||||
return getDirectory('birdnet_pi') . "/analyzing_now.txt";
|
||||
//
|
||||
@@ -1145,6 +1147,10 @@ function getFilePath($filename)
|
||||
} else if ($filename == "HUMAN.txt") {
|
||||
return getDirectory('birdnet_pi') . "/HUMAN.txt";
|
||||
//
|
||||
} else if ($filename == "IdentifiedSoFar.txt" ||$filename == "IDFILE" ) {
|
||||
$id_file_setting = $config['IDFILE'];
|
||||
return getDirectory('home') . str_replace('$HOME', '', $id_file_setting);
|
||||
//
|
||||
} else if ($filename == "include_species_list.txt") {
|
||||
return getDirectory('scripts') . "/include_species_list.txt";
|
||||
//
|
||||
|
||||
@@ -6,7 +6,8 @@ const TEST_HOMES = ['/home/pi', '/home/another_user', '/opt/birdnet'];
|
||||
$config = [
|
||||
"RECS_DIR" => "\$HOME/BirdSongs",
|
||||
"PROCESSED" => "\${RECS_DIR}/Processed",
|
||||
"EXTRACTED" => "\${RECS_DIR}/Extracted"
|
||||
"EXTRACTED" => "\${RECS_DIR}/Extracted",
|
||||
"IDFILE" => "\$HOME/BirdNET-Pi/IdentifiedSoFar.txt"
|
||||
];
|
||||
|
||||
function test()
|
||||
@@ -135,6 +136,10 @@ function test()
|
||||
$expected = $_test_home . "/BirdNET-Pi/HUMAN.txt";
|
||||
($result == $expected) ?: (print "failed file path 'HUMAN.txt', expected: " . ($expected) . " got: " . ($result) . "\r\n");
|
||||
|
||||
$result = getFilePath('IdentifiedSoFar.txt');
|
||||
$expected = $_test_home . "/BirdNET-Pi/IdentifiedSoFar.txt";
|
||||
($result == $expected) ?: (print "failed file path 'IdentifiedSoFar.txt', expected: " . ($expected) . " got: " . ($result) . "\r\n");
|
||||
|
||||
$result = getFilePath('include_species_list.txt');
|
||||
$expected = $_test_home . "/BirdNET-Pi/scripts/include_species_list.txt";
|
||||
($result == $expected) ?: (print "failed file path 'include_species_list.txt', expected: " . ($expected) . " got: " . ($result) . "\r\n");
|
||||
|
||||
Reference in New Issue
Block a user