mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-03-11 03:49:07 +00:00
Major performance improvement: Replace manual history aggregation with Tautulli's built-in stats APIs. This eliminates the need to fetch and process thousands of history records on every page load. Changes: - useTautulliStats composable completely rewritten: - Use get_home_stats for overall watch statistics (pre-aggregated) - Use get_plays_by_date for daily activity (already grouped by day) - Use get_plays_by_dayofweek for weekly patterns (pre-calculated) - Use get_plays_by_hourofday for hourly distribution (pre-calculated) - Remove fetchUserHistory() and manual aggregation functions - ActivityPage updates: - Fetch all data in parallel with Promise.all for faster loading - Use user_id instead of username for better API performance - Simplified data processing since API returns pre-aggregated data Benefits: - 10-100x faster data loading (no need to fetch/process full history) - Reduced network bandwidth (smaller API responses) - Less client-side computation (no manual aggregation) - Better scalability for large time ranges (365+ days) - Consistent with Tautulli's internal calculations