fix: load all year shards into combined feed, not just top 2

This commit is contained in:
Davide Scaini
2026-04-20 16:14:40 +02:00
parent db7047f210
commit 631e814d64
+2 -6
View File
@@ -354,13 +354,9 @@ def write_combined_feed(data_dir: Path) -> int:
activities = index.get("activities", []) activities = index.get("activities", [])
if shards: if shards:
year_shards = sorted( year_shards = [s for s in shards if re.match(r"index-\d{4}\.json$", s.get("url", ""))]
[s for s in shards if re.match(r"index-\d{4}\.json$", s.get("url", ""))],
key=lambda s: s["url"],
reverse=True,
)
base = index_path.parent base = index_path.parent
for shard in year_shards[:2]: for shard in year_shards:
shard_path = base / shard["url"] shard_path = base / shard["url"]
if shard_path.exists(): if shard_path.exists():
shard_data = json.loads(shard_path.read_text(encoding="utf-8")) shard_data = json.loads(shard_path.read_text(encoding="utf-8"))