Mattk70 / Chirpity-Electron

AI powered audio analyser for bird call visualisation, detection and cataloguing
https://chirpity.mattkirkland.co.uk
32 stars 1 forks source link

Audio source directory name containing # character causing issues #98

Closed Roman-53 closed 6 months ago

Roman-53 commented 6 months ago

Running Chirpity v1.6.8

When an audio source directory was renamed from "Zoom_Recorder" to "#Zoom_Recorder" I was unable to open and analyze the mp3 files in the directory.

Steps to reproduce the behavior:

  1. Create a "Zoom_Recorder" directory and add a mp3 file to it.
  2. Open the file in Chirpity and verify that the file can be analyzed.
  3. Close Chirpity
  4. Rename the directory to "#Zoom_Recorder"
  5. Attempt to open the mp3 file from the renamed directory, it will fail to open.
  6. Sometimes the file can be opened on the second attempt, but analysis fails to start normally.
  7. Close Chirpity and rename the directory back to "Zoom_Recorder"
  8. Open and analyze the mp3 file Chirpity normally.
Mattk70 commented 6 months ago

HI @Roman-53, this is because the # is a special character to the Javascript language when opening a file. Whilst it would be possible to override all the file IO functions to accommodate folders with a #, can you just not use them in your folder structure?

Roman-53 commented 6 months ago

Thank you for the prompt response Matt. Not a big issue for me but it might catch others out as no error message is generated. I only came across it because my backup script automatically backs up any directory starting with a #, which I use as a quick way to add a directory to the backup schedule. Thank you for producing Chirpity, a great application. I live in Australia and when I started using Chirpity I couldn't believe all the Barn Owl activity around our house. Eventually it dawned on me it was logging fruit bats as Barn Owls 🙂

Mattk70 commented 6 months ago

Actually, this isn't as tricky an issue as I first thought. I'd add a fix to 1.6.9, which will allow '#' in folder / file names.

I had no idea there were bats which called in the same frequerncy band as Owls!