Release list: filter by quality, codec, HDR, DV and language
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,7 +50,7 @@ func TestVisibleReleasesSort(t *testing.T) {
|
||||
{"hide rejected", true, sortBest, []string{"ok-1080-score", "ok-1080", "ok-720"}},
|
||||
}
|
||||
for _, tc := range tests {
|
||||
if got := guids(visibleReleases(all, tc.hide, tc.mode)); !equal(got, tc.want) {
|
||||
if got := guids(visibleReleases(all, tc.hide, tc.mode, attrFilter{})); !equal(got, tc.want) {
|
||||
t.Errorf("%s: got %v, want %v", tc.name, got, tc.want)
|
||||
}
|
||||
}
|
||||
@@ -108,3 +108,20 @@ func TestSummarizeSeasons(t *testing.T) {
|
||||
t.Error("seasonLabel")
|
||||
}
|
||||
}
|
||||
|
||||
func TestVisibleReleasesAttrFilter(t *testing.T) {
|
||||
rel := func(guid, title string) arr.Release { return arr.Release{GUID: guid, Title: title} }
|
||||
all := []arr.Release{
|
||||
rel("a", "Movie.2160p.DV.x265-G"),
|
||||
rel("b", "Movie.1080p.x264-G"),
|
||||
rel("c", "Movie.1080p.x265-G"),
|
||||
}
|
||||
got := guids(visibleReleases(all, false, sortBest, attrFilter{res: "1080p", codec: "x265"}))
|
||||
if !equal(got, []string{"c"}) {
|
||||
t.Errorf("1080p x265 = %v", got)
|
||||
}
|
||||
got = guids(visibleReleases(all, false, sortBest, attrFilter{hdr: "DV"}))
|
||||
if !equal(got, []string{"a"}) {
|
||||
t.Errorf("DV = %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user