Add optional MDBList movie ratings
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user