Make the codebase mypy-clean, drop dead media_utils and Pillow, rewrite README

This commit is contained in:
2026-10-17 09:17:37 +02:00
parent 4daf4e960d
commit 364b515e3c
14 changed files with 333 additions and 436 deletions
+3 -2
View File
@@ -6,6 +6,7 @@ value (e.g. rating 87 → tag "Hodnocení/87"), while the folder groups it
"""
import re
from collections.abc import Callable
def rating_band(rating: int) -> str:
@@ -18,14 +19,14 @@ def rating_band(rating: int) -> str:
return f"{low}–{high} %"
def _decade_band(value) -> str:
def _decade_band(value: str) -> str:
"""``decade_band`` transform: pull the leading integer and bucket it."""
match = re.search(r"\d+", str(value))
return rating_band(int(match.group())) if match else str(value)
# Named value transforms usable from the tag schema (config-driven, extensible).
TAG_TRANSFORMS = {
TAG_TRANSFORMS: dict[str | None, Callable[[str], str]] = {
None: str,
"identity": str,
"decade_band": _decade_band,