Repository navigation
Updated result view - #830
Merged
Merged
Conversation
Josef-Haupt
commented
Nov 3, 2025
Member
- the result table in the batch analysis tab now shows all invalid files with the corresponding error message
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances error handling for audio file analysis failures by providing specific error messages and reasons for failures. The changes improve user feedback by displaying both the invalid file paths and the specific reasons for failure (e.g., unrecognized format).
Key changes:
- Modified error handling to return specific error messages instead of None when file analysis fails
- Updated UI to display a two-column table showing invalid files and their failure reasons, or a success message when all files are processed
- Added localized strings for the new error messages and table headers across multiple languages
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| birdnet_analyzer/analyze/utils.py | Modified analyze_file() to return error messages as strings instead of None, updated combine_results() to handle string error results |
| birdnet_analyzer/gui/analysis.py | Updated return logic to preserve error message strings and handle both dict and string return types |
| birdnet_analyzer/gui/single_file.py | Enhanced error display to include the specific error message from failed analysis |
| birdnet_analyzer/gui/multi_file.py | Added error reason mapping and updated result grid to show both file paths and error reasons in two columns |
| birdnet_analyzer/lang/*.json | Added localization strings for error messages and new column headers across 10 languages |
Comments suppressed due to low confidence (3)
birdnet_analyzer/analyze/utils.py:704
- The return type annotation is outdated. The function now returns
dict[str, str] | strinstead ofdict[str, str] | None, as error cases return error message strings rather than None.
def analyze_file(item) -> dict[str, str] | None:
birdnet_analyzer/analyze/utils.py:716
- The docstring is outdated. The return type should be documented as 'dict or str' instead of 'dict or None', and should clarify that a string error message is returned when errors occur, while None is returned only when files are skipped.
"""
Analyzes an audio file and generates prediction results.
Args:
item (tuple): A tuple containing the file path (str) and configuration settings.
Returns:
dict or None: A dictionary of result file names if analysis is successful,
None if the file is skipped or an error occurs.
Raises:
Exception: If there is an error in reading the audio file or saving the results.
"""
birdnet_analyzer/analyze/utils.py:727
- The TODO comment suggests uncertainty about the return value for skipped files. With the new error handling approach returning strings for failures, this inconsistency should be addressed - consider whether skipped files should also return a descriptive string for consistency, or update the TODO to reflect the current design decision.
return None # or return path to combine later? TODO
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.