Trackers: horodatage discret de la dernière maj des données (cache 1h)

This commit is contained in:
jerem
2026-06-17 15:33:13 +02:00
parent b6e8aa7225
commit 767e514dad
3 changed files with 19 additions and 1 deletions

View File

@@ -64,6 +64,11 @@ async def build_context() -> dict:
)
now = datetime.now(ZoneInfo(config.timezone))
trk_ts = trackers.last_updated()
trackers_updated = (
datetime.fromtimestamp(trk_ts, ZoneInfo(config.timezone)).strftime("%Hh%M")
if trk_ts else None
)
return {
"width": config.width,
"height": config.height,
@@ -77,6 +82,7 @@ async def build_context() -> dict:
"nas": nas_status,
"codex": codex_status,
"trackers": tracker_stats,
"trackers_updated": trackers_updated,
"kobo": kobo.current(),
"updated": now.strftime("%H:%M"),
"stale": False,