Add NixOS module and deployment guide for lidarr-mb-gap

- Introduced a new NixOS module for the lidarr-mb-gap service, allowing users to configure and manage the report generation process through NixOS.
- Added a comprehensive deployment guide in `nixos/DEPLOYMENT.md`, detailing setup instructions, configuration options, and troubleshooting tips for deploying the service on NixOS and serving reports via Caddy.
- Updated `flake.nix` to export the new NixOS module.
- Enhanced the report generation scripts to support customizable output paths for generated reports.
This commit is contained in:
Danilo Reyes
2025-11-11 11:04:01 -06:00
parent d38fb12e17
commit e6f96107aa
5 changed files with 438 additions and 7 deletions

View File

@@ -2,12 +2,15 @@
import logging
from html import escape
from pathlib import Path
from typing import Dict, List
logger = logging.getLogger(__name__)
def generate_html_report(albums_to_add: List[Dict], albums_to_update: List[Dict]):
def generate_html_report(
albums_to_add: List[Dict], albums_to_update: List[Dict], output_path: Path = Path("missing_albums.html")
):
"""Generate an HTML report with clickable submission links"""
html_content = """<!DOCTYPE html>
<html lang="en">
@@ -355,6 +358,6 @@ def generate_html_report(albums_to_add: List[Dict], albums_to_update: List[Dict]
html_footer = "\n</body>\n</html>\n"
html_content = html_header + albums_html + html_footer
with open("missing_albums.html", "w", encoding="utf-8") as f:
with open(output_path, "w", encoding="utf-8") as f:
f.write(html_content)
logger.info("HTML report saved to missing_albums.html")
logger.info(f"HTML report saved to {output_path}")