pddpauw / BirdPi

A realtime acoustic bird classification system for the Raspberry Pi 5, based on BirdNET-Pi
Other
30 stars 6 forks source link

Setting Flickr API key results in uncaught TypeError exceptions in overview.php and todays_detections.php #2

Closed scott-ohiohealth-test closed 7 months ago

scott-ohiohealth-test commented 7 months ago

I'm seeing what I think is a bug in the Flickr implementation:

After setting the Flickr API key to attempt to get bird photos, the overview page doesn't show photos, and instead shows the text of two exceptions.

Steps to reproduce:

  1. Request an API key from Flickr
  2. Set a Flickr API key under Tools/Settings/API key by pasting the API key into the box on the page
  3. Click apply

Expected behavior: After setting a Flickr API key, the overview page should show photos of the birds detected from Flickr.

Actual behavior: After setting a Flickr API key, the text of couple exceptions are shown instead:

Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, bool given in /home/xxxxx/BirdNET-Pi/scripts/overview.php:161 Stack trace: #0 /home/xxxxx/BirdNET-Pi/scripts/overview.php(161): array_map() #1 {main} thrown in /home/xxxxx/BirdNET-Pi/scripts/overview.php on line 161

Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, bool given in /home/xxxxx/BirdNET-Pi/scripts/todays_detections.php:288 Stack trace: #0 /home/xxxxx/BirdNET-Pi/scripts/todays_detections.php(288): array_map() #1 {main} thrown in /home/xxxxx/BirdNET-Pi/scripts/todays_detections.php on line 288

Environment Official Raspberry PI 4

Latest BirdNet from ppdpauw repo as of 2/3/24, installed from script here https://github.com/pddpauw/BirdPi?tab=readme-ov-file#intro Flickr API key generated on 2/3/24.

pixelshaper commented 7 months ago

Line 288 is looking for the file $home."/BirdNET-Pi/scripts/blacklisted_images.txt which doesn't exist. I fixed this error by creating an empty file with the same name.

pddpauw commented 7 months ago

thanks for this, will create this txt file as empty file during installation