Commit Graph

8 Commits

Author SHA1 Message Date
Danilo Reyes
2b1a92fb49 Add new API endpoints for media retrieval by country and enhance configuration
Some checks failed
Test Suite / test (push) Has been cancelled
- Introduced `/api/tmdb` and `/api/collection/missing-locations` endpoints to the backend for improved media management.
- Added a new `get_media_by_country` function in the collection API to fetch media items based on country codes.
- Updated configuration to allow overriding *arr base URLs via environment variables for better flexibility.
- Enhanced frontend with a new `MissingLocations` component and integrated it into the routing structure.
- Improved the `CollectionMap` component to handle country selection and display media items accordingly.
- Added testing dependencies in `requirements.txt` and updated frontend configuration for testing support.
2025-12-28 22:35:06 -06:00
Danilo Reyes
4caba81599 Enhance country data retrieval and error handling in WatchedMap component
- Improved country code extraction logic to handle null values and prevent rendering errors.
- Added error handling for API responses to ensure graceful degradation in case of failures.
- Updated the logic for determining country codes from GeoJSON features to account for missing values.
- Set default values for watched items and summary to avoid application crashes during data fetch failures.
2025-12-28 22:13:19 -06:00
Danilo Reyes
1c0ca487fe Enhance error handling and logging in sync functions
- Added connection status check for Radarr, Sonarr, and Lidarr with appropriate error logging for invalid API keys and connection issues.
- Improved logging to indicate the number of movies, series, and artists fetched from each service.
- Updated sync functions to handle exceptions more gracefully, providing clearer error messages and context.
- Included detailed logging for the start of sync processes and API key configurations.
2025-12-28 21:59:59 -06:00
Danilo Reyes
335a53ee62 Add country metadata extraction and assignment features
- Updated `README.md` to include instructions for setting up the TMDB API key and new admin endpoints for managing country metadata.
- Implemented `/admin/missing-countries` endpoint to list media items without country metadata, with filtering options for source and media type.
- Added `/admin/assign-country` endpoint to manually assign a country code to a media item.
- Enhanced country extraction logic in `sync.py` to utilize TMDB and MusicBrainz APIs for automatic country retrieval based on available metadata.
- Updated configuration in `config.py` to include optional TMDB API key setting.
- Improved error handling and logging for country extraction failures.
- Ensured that country data is stored and utilized during media item synchronization across Radarr, Sonarr, and Lidarr.
2025-12-28 21:47:03 -06:00
Danilo Reyes
6cffbef8c6 fixes 2025-12-28 21:38:38 -06:00
Danilo Reyes
c0371d85ce Refactor database connection handling in API endpoints
- Removed direct pool checks and replaced them with a centralized database initialization method in `init_db`.
- Updated API endpoints in `admin.py`, `collection.py`, `pins.py`, and `watched.py` to ensure the database connection pool is initialized before usage.
- Enhanced error handling to raise HTTP exceptions if the database is unavailable.
- Improved the `init_db` function in `database.py` to prevent multiple simultaneous initializations using an asyncio lock.
2025-12-28 21:37:31 -06:00
Danilo Reyes
98622c4119 Add host configuration for backend server and update documentation
- Introduced a new `host` option in `flake.nix` to specify the server's bind address, defaulting to `0.0.0.0`.
- Updated `run.sh` to use the `HOST` environment variable for server binding.
- Modified `config.py` to read the `HOST` from environment variables, defaulting to `0.0.0.0`.
- Enhanced `README.md` with instructions for setting up the `HOST` variable and clarified access details for development and production modes.
- Adjusted `vite.config.ts` to allow frontend access from other computers by default.
2025-12-28 21:20:21 -06:00
Danilo Reyes
96fcc2b9e8 init 2025-12-28 20:59:09 -06:00