Commit Graph

4 Commits

Author SHA1 Message Date
Glenn Thompson 75b27c5424 Add city-level tracking to geo stats
- Update update-geo-stats to accept optional city parameter
- Update get-cached-geo to cache and return city along with country
- Update collect-geo-stats-for-mount and collect-geo-stats-from-web-listeners
  to track by country+city
- Revert migration to keep UNIQUE(date, country_code, city) constraint
2025-12-12 13:55:55 -05:00
Glenn Thompson 009e812f8c Fix listener_geo_stats unique constraint to match code
The ON CONFLICT clause uses (date, country_code) but the table had
UNIQUE(date, country_code, city). Changed to UNIQUE(date, country_code).
2025-12-12 13:55:55 -05:00
Glenn Thompson 46d57e2775 Fix timestamp consistency across all tables
- Update USERS table schema to use TIMESTAMP instead of integer
- Add migration 003 to convert existing integer timestamps to TIMESTAMP
- Remove timestamp-to-unix calls in playlist-management.lisp (use DB default)
- Update user-management.lisp to use postmodern:execute for last-login update
- All timestamp columns now consistently use PostgreSQL TIMESTAMP type
2025-12-10 11:11:32 -05:00
Glenn Thompson 4be3b83da1 Add listener statistics feature
- Add database schema for listener snapshots, sessions, and aggregates
- Implement background polling of Icecast admin XML stats
- Add API endpoints for current, daily, and geo stats
- Add listener stats section to admin dashboard with auto-refresh
- GDPR compliant: IP hashing, data retention cleanup
2025-12-10 11:11:32 -05:00