fix: place system pages by the reviewed sections

The site placed a system page through an index of folders only, while
own_section reads the folders plus the reviewed parents. The Atom has no
folder of its own and was placed on the BBC Micro section while every link
named its Atom section. Both now build their index from section_pairs_of,
and a test checks every id against own_section on the repository data.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 10:30:59 +01:00
1 parent 15f913d0ba
commit b8fe881327
3 files changed
+71 -12

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ from __future__ import annotations
from dataclasses import dataclass
from model.collection import copy_places, manufacturer_slug
from model.systemnames import console_index, spelled_section
from model.systemnames import console_index, section_pairs_of, spelled_section
from resolve.localfile import resolution_is_hash_exact, resolve_local_file
from resolve.ownership import BUCKET_FOLDERS, names_manufacturer
@@ -179,7 +179,7 @@ def system_pages_from_data(
# Map system_id -> (manufacturer, console) via platform file entries
index = _FolderIndex(
db, name_consoles,
console_index((mfr, console) for mfr, consoles in manufacturers.items() for console in consoles),
console_index(section_pairs_of(manufacturers)),
_copies_by_path(db),
)
pages: dict[str, tuple[str, str]] = {}