style: apply formatter cleanup (import order, whitespace)

This commit is contained in:
2026-02-22 11:26:06 +01:00
parent 8e262c947c
commit 87bf0d71cd
6 changed files with 56 additions and 55 deletions

View File

@@ -643,7 +643,7 @@ the TMDB API response. All tags are written whenever the NFO is created or
updated via `create_tvshow_nfo()` / `update_tvshow_nfo()`.
| NFO tag | TMDB source field | Required |
| --------------- | ---------------------------------------------- | -------- |
| --------------- | ----------------------------------------------------- | -------- |
| `title` | `name` | ✅ |
| `originaltitle` | `original_name` | ✅ |
| `showtitle` | `name` (same as `title`) | ✅ |
@@ -694,7 +694,7 @@ automatically repairs any that are missing required tags.
### Tags Checked (13 required)
| XPath | Tag name |
| -------------- | --------------- |
| ----------------- | --------------- |
| `./title` | `title` |
| `./originaltitle` | `originaltitle` |
| `./year` | `year` |
@@ -712,7 +712,7 @@ automatically repairs any that are missing required tags.
### Log Messages
| Message | Meaning |
| --- | --- |
| ----------------------------------------------------------- | ------------------------------------------------- |
| `NFO repair scan complete: 0 of N series queued for repair` | All NFOs are complete — no action needed |
| `NFO repair scan complete: X of N series queued for repair` | X series had incomplete NFOs and have been queued |
| `NFO repair scan skipped: TMDB API key not configured` | Set `tmdb_api_key` in `data/config.json` |
@@ -732,7 +732,7 @@ This calls `NFOService.update_tvshow_nfo()` directly and overwrites the existing
### Source Files
| File | Purpose |
| ---- | ------- |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `src/core/services/nfo_repair_service.py` | `REQUIRED_TAGS`, `parse_nfo_tags`, `find_missing_tags`, `nfo_needs_repair`, `NfoRepairService` |
| `src/server/services/initialization_service.py` | `perform_nfo_repair_scan` startup hook |
| `src/server/fastapi_app.py` | Wires `perform_nfo_repair_scan` into the lifespan |

View File

@@ -219,8 +219,8 @@ async def lifespan(_application: FastAPI):
from src.server.services.initialization_service import (
perform_initial_setup,
perform_media_scan_if_needed,
perform_nfo_scan_if_needed,
perform_nfo_repair_scan,
perform_nfo_scan_if_needed,
)
try:

View File

@@ -4,7 +4,7 @@ These tests confirm that:
1. The lifespan calls perform_nfo_repair_scan after perform_media_scan_if_needed.
2. Series with incomplete NFO files are queued via the background_loader.
"""
from unittest.mock import AsyncMock, MagicMock, patch, call
from unittest.mock import AsyncMock, MagicMock, call, patch
import pytest
@@ -15,6 +15,7 @@ class TestNfoRepairScanCalledOnStartup:
def test_perform_nfo_repair_scan_imported_in_lifespan(self):
"""fastapi_app.py lifespan imports perform_nfo_repair_scan."""
import importlib
import src.server.fastapi_app as app_module
source = importlib.util.find_spec("src.server.fastapi_app").origin

View File

@@ -27,8 +27,8 @@ from src.server.services.initialization_service import (
_validate_anime_directory,
perform_initial_setup,
perform_media_scan_if_needed,
perform_nfo_scan_if_needed,
perform_nfo_repair_scan,
perform_nfo_scan_if_needed,
)

View File

@@ -7,8 +7,8 @@ from unittest.mock import AsyncMock, MagicMock
import pytest
from src.core.services.nfo_repair_service import (
NfoRepairService,
REQUIRED_TAGS,
NfoRepairService,
find_missing_tags,
nfo_needs_repair,
parse_nfo_tags,