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.
This commit is contained in:
Danilo Reyes
2025-12-28 22:35:06 -06:00
parent 4caba81599
commit 2b1a92fb49
32 changed files with 2733 additions and 76 deletions

60
scripts/setup-test-vm.sh Executable file
View File

@@ -0,0 +1,60 @@
#!/usr/bin/env bash
# Script to set up a test VM with *arr services
# This script can be run in CI/CD or manually to configure test services
set -e
echo "Setting up test VM for Movie Map..."
# Configuration
RADARR_URL="${RADARR_URL:-http://localhost:7878}"
SONARR_URL="${SONARR_URL:-http://localhost:8989}"
LIDARR_URL="${LIDARR_URL:-http://localhost:8686}"
# Test API keys (should be set via environment variables in CI/CD)
RADARR_API_KEY="${RADARR_API_KEY:-test-radarr-key}"
SONARR_API_KEY="${SONARR_API_KEY:-test-sonarr-key}"
LIDARR_API_KEY="${LIDARR_API_KEY:-test-lidarr-key}"
echo "Waiting for services to be ready..."
sleep 10
# Function to wait for service to be ready
wait_for_service() {
local url=$1
local name=$2
local max_attempts=30
local attempt=0
echo "Waiting for $name to be ready at $url..."
while [ $attempt -lt $max_attempts ]; do
if curl -s -f "$url/api/v3/system/status" > /dev/null 2>&1 || \
curl -s -f "$url/api/v3/system/status" > /dev/null 2>&1 || \
curl -s -f "$url/api/v1/system/status" > /dev/null 2>&1; then
echo "$name is ready!"
return 0
fi
attempt=$((attempt + 1))
sleep 2
done
echo "Warning: $name did not become ready in time"
return 1
}
# Wait for services (if they're running)
wait_for_service "$RADARR_URL" "Radarr" || true
wait_for_service "$SONARR_URL" "Sonarr" || true
wait_for_service "$LIDARR_URL" "Lidarr" || true
echo "Test VM setup complete!"
echo "RADARR_URL=$RADARR_URL"
echo "SONARR_URL=$SONARR_URL"
echo "LIDARR_URL=$LIDARR_URL"
echo ""
echo "Note: In a real CI/CD environment, you would:"
echo "1. Start *arr services (via Docker, NixOS, or other means)"
echo "2. Configure API keys via their web interfaces or APIs"
echo "3. Add test data (10 movies, 10 shows, 10 artists)"
echo "4. Set environment variables for the test suite"