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

43
nix/test-vm-simple.nix Normal file
View File

@@ -0,0 +1,43 @@
# Simplified NixOS VM configuration for testing Movie Map
# This focuses on PostgreSQL; *arr services should be configured separately
{ config, pkgs, lib, ... }:
{
networking = {
hostName = "moviemap-test-vm";
firewall = {
enable = true;
allowedTCPPorts = [
8080 # Movie Map backend
5432 # PostgreSQL
];
};
};
# PostgreSQL configuration
services.postgresql = {
enable = true;
ensureDatabases = [ "moviemap_test" ];
ensureUsers = [
{
name = "moviemap";
ensureDBOwnership = true;
}
];
authentication = ''
local all all trust
host all all 0.0.0.0/0 trust
'';
settings = {
listen_addresses = "'*'";
};
};
# System packages
environment.systemPackages = with pkgs; [
curl
jq
postgresql
];
}

102
nix/test-vm.nix Normal file
View File

@@ -0,0 +1,102 @@
# NixOS VM configuration for testing Movie Map
# This VM includes PostgreSQL, Radarr, Sonarr, and Lidarr with test data
{ config, pkgs, lib, ... }:
{
# Enable QEMU guest agent for better VM management
services.qemuGuest.enable = true;
# Networking - allow external access
networking = {
hostName = "moviemap-test-vm";
firewall = {
enable = true;
allowedTCPPorts = [
8080 # Movie Map backend
5432 # PostgreSQL
7878 # Radarr
8989 # Sonarr
8686 # Lidarr
];
};
};
# PostgreSQL configuration
services.postgresql = {
enable = true;
ensureDatabases = [ "moviemap_test" ];
ensureUsers = [
{
name = "moviemap";
ensureDBOwnership = true;
}
];
authentication = ''
local all all trust
host all all 0.0.0.0/0 trust
'';
settings = {
listen_addresses = "'*'";
};
};
# Radarr configuration
services.radarr = {
enable = true;
openFirewall = true;
user = "radarr";
group = "radarr";
};
# Sonarr configuration
services.sonarr = {
enable = true;
openFirewall = true;
user = "sonarr";
group = "sonarr";
};
# Lidarr configuration
services.lidarr = {
enable = true;
openFirewall = true;
user = "lidarr";
group = "lidarr";
};
# Create test API keys for *arr services
# These will be set via environment variables in the CI/CD
# For now, we'll create a script that generates them
systemd.services.setup-arr-services = {
description = "Setup *arr services with test API keys";
wantedBy = [ "multi-user.target" ];
after = [ "radarr.service" "sonarr.service" "lidarr.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
# Wait for services to be ready
sleep 10
# Note: In a real setup, you would configure API keys via the *arr APIs
# For testing, we'll use environment variables set by CI/CD
echo "Test VM setup complete"
'';
};
# Environment variables for test configuration
environment.variables = {
TEST_RADARR_URL = "http://localhost:7878";
TEST_SONARR_URL = "http://localhost:8989";
TEST_LIDARR_URL = "http://localhost:8686";
};
# System packages
environment.systemPackages = with pkgs; [
curl
jq
postgresql
];
}