0.2.45 - Advanced analytics, logout old versions

This commit is contained in:
ponzischeme89
2026-08-10 20:24:22 +12:00
parent 63f0768507
commit 56c1167382
32 changed files with 1125 additions and 452 deletions
+14
View File
@@ -63,3 +63,17 @@ func TestRecommendationWeightsMustBeJSON(t *testing.T) {
t.Fatal("expected invalid recommendation weights to fail")
}
}
func TestAnalyticsRetentionCannotDropBelowThirtyDays(t *testing.T) {
t.Setenv("MEMBY_EMBY_URL", "http://emby")
t.Setenv("MEMBY_DATABASE_URL", "postgres://memby")
t.Setenv("MEMBY_ANALYTICS_RETENTION", "168h")
cfg, err := Load()
if err != nil {
t.Fatal(err)
}
if cfg.AnalyticsRetention != 30*24*time.Hour {
t.Fatalf("analytics retention = %v, want 30 days", cfg.AnalyticsRetention)
}
}