fix: load all year shards into combined feed, not just top 2
This commit is contained in:
@@ -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"))
|
||||||
|
|||||||
Reference in New Issue
Block a user