mirror of
https://github.com/idanoo/autobrr
synced 2025-07-22 16:29:12 +00:00
fix(filters): add support for year-less titles (#685)
* fix(filters): add support for year-less titles * chore: update pkg * fix: broken tests --------- Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
27f8b14678
commit
af43c98632
5 changed files with 90 additions and 36 deletions
|
@ -858,3 +858,53 @@ func TestRelease_DownloadTorrentFile(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_getUniqueTags(t *testing.T) {
|
||||
type args struct {
|
||||
target []string
|
||||
source []string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want []string
|
||||
}{
|
||||
{
|
||||
name: "1",
|
||||
args: args{
|
||||
target: []string{},
|
||||
source: []string{"mp4"},
|
||||
},
|
||||
want: []string{"mp4"},
|
||||
},
|
||||
{
|
||||
name: "2",
|
||||
args: args{
|
||||
target: []string{"mp4"},
|
||||
source: []string{"mp4"},
|
||||
},
|
||||
want: []string{"mp4"},
|
||||
},
|
||||
{
|
||||
name: "3",
|
||||
args: args{
|
||||
target: []string{"mp4"},
|
||||
source: []string{"mp4", "dv"},
|
||||
},
|
||||
want: []string{"mp4", "dv"},
|
||||
},
|
||||
{
|
||||
name: "4",
|
||||
args: args{
|
||||
target: []string{"dv"},
|
||||
source: []string{"mp4", "dv"},
|
||||
},
|
||||
want: []string{"dv", "mp4"},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
assert.Equalf(t, tt.want, getUniqueTags(tt.args.target, tt.args.source), "getUniqueTags(%v, %v)", tt.args.target, tt.args.source)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue