pvr: add options and support for anime (#17)

* pvr: begin adding options

* pvr: add ability to configure add behaviour via config

* pvr: add skip_anime

* pvr: do not continue processing item if lookup failed or add to pvr failed
This commit is contained in:
l3uddz
2021-02-20 20:01:04 +00:00
committed by GitHub
parent 523e561666
commit a2848439b9
14 changed files with 283 additions and 30 deletions

View File

@@ -81,3 +81,39 @@ func TestAtoi(t *testing.T) {
})
}
}
func TestBoolOrDefault(t *testing.T) {
type args struct {
val *bool
defaultVal bool
}
tests := []struct {
name string
args args
want bool
}{
{
name: "expect default",
args: args{
val: nil,
defaultVal: true,
},
want: true,
},
{
name: "expect value",
args: args{
val: new(bool),
defaultVal: true,
},
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := BoolOrDefault(tt.args.val, tt.args.defaultVal); got != tt.want {
t.Errorf("BoolOrDefault() = %v, want %v", got, tt.want)
}
})
}
}