Complete historical snapshots API metadata

This commit is contained in:
devRaGonSa
2026-03-23 12:19:38 +01:00
parent b33aef55ee
commit 14820888a6
4 changed files with 82 additions and 58 deletions

View File

@@ -428,12 +428,15 @@ def _build_historical_snapshot_metadata(snapshot: dict[str, object] | None) -> d
"source_range_start": None,
"source_range_end": None,
"is_stale": True,
"freshness": "stale",
}
is_stale = bool(snapshot.get("is_stale", False))
return {
"generated_at": snapshot.get("generated_at"),
"source_range_start": snapshot.get("source_range_start"),
"source_range_end": snapshot.get("source_range_end"),
"is_stale": bool(snapshot.get("is_stale", False)),
"is_stale": is_stale,
"freshness": "stale" if is_stale else "fresh",
}