feat: Implement region pack download with progress tracking#26
Merged
feat: Implement region pack download with progress tracking#26
Conversation
The "Download Region Pack for My Location" button was missing its click handler. Added regionPackManager object that: - Listens for button clicks - Calls the POST /api/update/region-pack/download endpoint - Shows download status via button text and notifications - Handles success/error states appropriately Note: The API endpoint queues the download request but the background worker to process the queue is not yet implemented.
- Create RegionPackService for reusable region pack download logic - Add download_from_url method for daemon use without full RegionPackInfo - Integrate region pack download processing into update daemon monitor loops - Store download progress in Redis for UI status updates - Queue download requests via Redis for inter-process communication
- Add RegionPackDownloadStatusResponse Pydantic model for API docs - Add /region-pack/download-status endpoint to poll download progress - Update JavaScript to poll for progress and show percentage on button - Add i18n translation keys for download status messages - Fix region pack detection to recognize new na-east-### naming pattern - Banner now correctly hides when region pack is installed
- Fix species checklist 500 error when there are no detections by handling NULL values from SQL SUM (which returns NULL for empty result sets) - Add comprehensive test suite for RegionPackService to meet 77% coverage threshold (region_pack_service.py now has 96% coverage)
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.
Summary
na-east-###naming patternChanges
New Files
src/birdnetpi/releases/region_pack_service.py- Reusable download logic for CLI and daemonModified Files
src/birdnetpi/daemons/update_daemon.py- Process region pack download requests from Redissrc/birdnetpi/releases/region_pack_status.py- Fix pack detection regex for new naming formatsrc/birdnetpi/web/models/update.py- AddRegionPackDownloadStatusResponsePydantic modelsrc/birdnetpi/web/routers/update_api_routes.py- Add/region-pack/download-statusendpointsrc/birdnetpi/web/routers/i18n_api_routes.py- Add translation keys for download statussrc/birdnetpi/web/static/js/update.js- Add progress polling and UI updatesHow It Works
region_pack:download_status)Test Plan