Activity model (user_activity.py):
- Ignore pings from obvious bots so the feed reflects real humans
- Merge a logged-in user's anonymous doc by exact anonymous_id only (never
by shared NAT IP, which could tag another visitor as the logged-in user)
- Count distinct active visitors via aggregation so count matches the feed
- Track page views (on navigation) and accumulated online time per visitor
- New activity_history collection (5-min buckets, 7-day TTL) powering admin
trend charts; dedup-aware queries with field-length caps and graceful
Mongo failures so presence tracking never breaks a page
- Fix naive/aware datetime bug that made every second+ ping fail silently,
keeping last_seen stale (visitors would drop out of "active" after 5 min)
Routes + dashboard:
- Rate-limit /api/activity/ping, pass User-Agent through for bot filtering
- /api/activity/trend endpoint (admin) and enriched /api/admin/dashboard
with registered/guest split, top pages, and 24h trend
- Admin dashboard…
Add self-hosted image upscaler for crisp HD/4K spotlight art
AniList caps covers at 460x690 and banners at 1900x400, and free upscale
CDNs block s4.anilist.co, so the home page hero looked blurry. Add an
/api/img proxy that upscales with Pillow (LANCZOS + unsharp) and caches on
disk, and route spotlight backdrop images through it via a new hd_img
filter.
Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>