Skip to content

Conversation

@tphakala
Copy link
Contributor

Problem

The "Invalid audio files" error message in the batch analysis tab was persisting even after selecting new input or output directories. Users reported that once this message appeared, it would remain visible indefinitely, even after restarting the application or processing valid files.

Solution

Modified the directory selection handlers to clear the result_grid component whenever a new directory is selected. This provides proper feedback to users by removing stale error messages when they change their input or output selections.

Changes:

  • Updated select_directory_on_empty() to return a grid clear operation
  • Updated select_directory_wrapper() to return a grid clear operation
  • Moved event handler registration to after result_grid is defined to access the component

Testing

Tested by:

  1. Selecting a directory with invalid audio files
  2. Observing the error message display
  3. Selecting a new directory
  4. Confirming the error message is cleared

Fixes #809

The error message was not being cleared when selecting a new input or
output directory. This fix ensures that the result_grid component is
cleared whenever a new directory is selected, providing proper feedback
to users.

Fixes birdnet-team#809
@Josef-Haupt
Copy link
Member

Tbh I can not reproduce the problem you are describing on current main. After trying the Testing steps I can say main behaves the same way as this PR does. Am I missing something? Also there might be a Gradio version mismatch, I forgot to update the version in the pyproject.toml after the last release.
The result grid should only change after analysis was run, and not on the selection of the directory imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Invalid audio files" dialog is permanent

2 participants