Refactor Filter options into a struct

It was already a lot of options for one method and I am going to add
another one in the next commit.
This commit is contained in:
Gordian Schoenherr
2024-11-26 16:19:23 +09:00
parent 88ef8efba5
commit 3b785e4165
12 changed files with 167 additions and 71 deletions
+8 -1
View File
@@ -596,7 +596,14 @@ func (repo *RemoteRepo) ApplyFilter(dependencyOptions int, filterQuery PackageQu
emptyList.PrepareIndex()
oldLen = repo.packageList.Len()
repo.packageList, err = repo.packageList.FilterWithProgress([]PackageQuery{filterQuery}, repo.FilterWithDeps, emptyList, dependencyOptions, repo.Architectures, progress)
repo.packageList, err = repo.packageList.Filter(FilterOptions{
Queries: []PackageQuery{filterQuery},
WithDependencies: repo.FilterWithDeps,
Source: emptyList,
DependencyOptions: dependencyOptions,
Architectures: repo.Architectures,
Progress: progress,
})
if repo.packageList != nil {
newLen = repo.packageList.Len()
}