1

Affiche le part_num sur les frises de têtes

This commit is contained in:
2025-12-02 22:26:52 +01:00
parent 43062b7ed4
commit 9158b7440c
5 changed files with 23 additions and 12 deletions

View File

@@ -58,6 +58,7 @@ def build_character_collage(
font: ImageFont.ImageFont,
missing_paths: Set[str] | None = None,
image_filename: str = "minifig.jpg",
label_field: str = "fig_num",
image_height: int = 260,
label_height: int = 44,
spacing: int = 28,
@@ -69,7 +70,8 @@ def build_character_collage(
for row in entries:
image_path = resources_dir / row["set_id"] / sanitized / image_filename
owned = "*" if row.get("in_collection", "").lower() == "true" else ""
label = f"{row['year']} - {row['set_num']}{owned} ({row['fig_num']})"
label_value = row[label_field]
label = f"{row['year']} - {row['set_num']}{owned} ({label_value})"
if str(image_path) in missing:
image = build_placeholder(image_height)
else:
@@ -94,6 +96,7 @@ def build_character_collages(
destination_dir: Path,
missing_paths: Set[str] | None = None,
image_filename: str = "minifig.jpg",
label_field: str = "fig_num",
image_height: int = 260,
label_height: int = 44,
spacing: int = 28,
@@ -111,6 +114,7 @@ def build_character_collages(
font,
missing_paths=missing_paths,
image_filename=image_filename,
label_field=label_field,
image_height=image_height,
label_height=label_height,
spacing=spacing,