Server changes/Sonarr
This commit is contained in:
@@ -153,6 +153,16 @@ func TestRankRespectsLimit(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCollectionAffinityIsCaseInsensitive(t *testing.T) {
|
||||
profile := Profile{
|
||||
GenreWeights: map[string]float64{"Comedy": 2},
|
||||
StudioWeights: map[string]float64{"Apple TV+": 0.5},
|
||||
}
|
||||
if got := profile.CollectionAffinity([]string{"comedy"}, []string{"apple tv+"}); got != 2.5 {
|
||||
t.Fatalf("CollectionAffinity = %v, want 2.5", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecodeKeepsRawPayload(t *testing.T) {
|
||||
raw := json.RawMessage(`{"Id":"1","Name":"Dune","Type":"Movie","Genres":["Science Fiction"],"ImageTags":{"Primary":"abc"}}`)
|
||||
items := Decode([]json.RawMessage{raw, json.RawMessage(`{"broken":`), json.RawMessage(`{"Name":"no id"}`)})
|
||||
|
||||
Reference in New Issue
Block a user