This commit is contained in:
ponzischeme89
2026-08-27 07:31:57 +12:00
parent 394a6d9b57
commit b0b8990f90
24 changed files with 388 additions and 477 deletions
+19
View File
@@ -5,6 +5,8 @@ import (
"path/filepath"
"testing"
"time"
"github.com/ponzischeme89/memby/server/internal/emby"
)
func TestReleasePublishTokenCanComeFromSecretFile(t *testing.T) {
@@ -109,3 +111,20 @@ func TestAnalyticsRetentionCannotDropBelowThirtyDays(t *testing.T) {
t.Fatalf("analytics retention = %v, want 30 days", cfg.AnalyticsRetention)
}
}
func TestLegacyClientNameOverrideIsIgnored(t *testing.T) {
t.Setenv("MEMBY_EMBY_URL", "http://emby")
t.Setenv("MEMBY_DATABASE_URL", "postgres://memby")
t.Setenv("MEMBY_CLIENT_NAME", "Memby")
cfg, err := Load()
if err != nil {
t.Fatal(err)
}
if cfg.ClientName != emby.DefaultClientName {
t.Fatalf("client name = %q, want %q", cfg.ClientName, emby.DefaultClientName)
}
if cfg.IgnoredClientName != "Memby" {
t.Fatalf("ignored client name = %q, want Memby", cfg.IgnoredClientName)
}
}