Add optional MDBList movie ratings

This commit is contained in:
ponzischeme89
2026-08-03 08:55:52 +12:00
parent b6b2a9c25a
commit 666da9c5d3
18 changed files with 840 additions and 4 deletions
+14
View File
@@ -25,6 +25,20 @@ func TestPlaybackPolicyDefaultsAndClampsDuration(t *testing.T) {
}
}
func TestMDBListSettingsAreOptionalAndNormalizeSources(t *testing.T) {
defaults := DefaultMDBListSettings()
if defaults.Enabled || defaults.APIKey != "" || len(defaults.Sources) == 0 {
t.Fatalf("default MDBList settings = %+v", defaults)
}
got := normalizeMDBListSettings(MDBListSettings{
APIKey: " secret ", Sources: []string{"IMDb", "imdb", "unknown", "letterboxd"},
})
if got.APIKey != "secret" || len(got.Sources) != 2 ||
got.Sources[0] != "imdb" || got.Sources[1] != "letterboxd" {
t.Fatalf("normalized MDBList settings = %+v", got)
}
}
func TestFeaturePolicyDefaultsAreRecoverable(t *testing.T) {
policy := normalizeFeaturePolicy(FeaturePolicy{})
if policy.Overrides == nil || policy.SafeMode || policy.Revision != 0 {