The Config and Advanced setting pages received changes to use the new setSetting() function which looks after creating or updated the setting in the required config files.
Optionally it also specification of a command to run after saving the settings.
Some variables like models, audio formats and frequency shift tools were also moved into common.php
Service Controls page received changes with the replacement of the actual command to execute with a sort of shorthand human friendly version e.g. service <action> <service_name> -- service restart livestream.service
These commands map to the original commands in serviceMaintenance() so this could be called through the API without needing the full-blown commend.
views.php was updated to accommodate this also
System Controls page received a small change to make the process checking for new git updates or getting the last commit hash a single function call.
Include and Exclude species updated to use getFilePath() to generate a path to the required file instead of the hard coded path
Views.php also received similar treatment with replacing some hard coded paths with generated paths, but logic changes to handle the change in running service commands
All SQL Queries were moved into their respective functions and parameterized, there were some slight logic changes in the front end pages to accommodate data being returned differently but existing functionality is maintained
A common function is used to execute the queries and looks after binding any parameterized values that have been supplied.
Other code for deleting / protecting detection's, frequency shift, Flickr API call etc have also been moved into common.php to be used later by the API
Two new functions getDirectory and getFilePath were introduced in aims and make it easier to relocate files. This will be worked into all existing php files to replace hardcoded paths
Update the saving of the LogLevel_ settings to create the setting in the config file if it doesn't exist at the time of saving, the setting is created with the chosen value.
Moves the RTSP javascript code into it's script tag and moved it be near the controls for the RTSP URL.
Small fix for now to handle of RTSP streams that may contain more than 1 audio stream within them, we just tell ffmpeg to use the first audio stream for the recording.
A future enhancement to this is to allow the user to to set what audio stream to just in case there is a scenario where the first one doesn't work for some reason.
After some services were recently quieted down by adjusting the log level for e.g ffmpeg. It would be nice if the user can easily adjust the log level again so that that they can investigate or debug a issue since output is not generated by default, so now the Livestream, Spectrogream and Birdnet Recording have a adjustable log levels to help with this.
The Spectrogram service was stopping after it completed it's work (no issue here) and the system would start it again 10 seconds later, sometimes it would stop and start multiple times a second (no file to analyse maybe)
Added a while loop to that it would just keep running and sleeping for the number of seconds of the recording length setting.
Attempt to quieten the amount of log noise being generated by some of the birdnet services visible in the syslog and daemon.log
Recording service
When using RTSP streams the recording service is generating massive amounts of noise in the logs as it's basically outputting all it's startup info and also outputting stream and export info.
- Set the log level to only output errors
Also the birdnet_recoding service script is outputting it;s contents, I assume was doing this because of the set -x option at the beginning,
-Commenting this fixed that issue
Analysis Service
Small change to this it doesn't output a error when it can't find today's recording directory. It's a non issue if your recording via sound card but it pops up a bit when using RTSP streams as that directory is never created.
Livestream Service
Same treatment as the recording service, set log level to error. It was previously set to info and would occasionally output a massive chunk of output.. presumably abut the encoding processes.