mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Remove ONLY_SHOW_RELEVANT_REPOS setting (#21962)
Every user can already disable the filter manually, so the explicit setting is absolutely useless and only complicates the logic. Previously, there was also unexpected behavior when multiple query parameters were present. --------- Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
ea13b23349
commit
4d20a4a1ba
5 changed files with 9 additions and 18 deletions
|
@ -494,7 +494,7 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
|
|||
}
|
||||
|
||||
if opts.OnlyShowRelevant {
|
||||
// Only show a repo that either has a topic or description.
|
||||
// Only show a repo that has at least a topic, an icon, or a description
|
||||
subQueryCond := builder.NewCond()
|
||||
|
||||
// Topic checking. Topics are present.
|
||||
|
@ -504,13 +504,13 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
|
|||
subQueryCond = subQueryCond.Or(builder.And(builder.Neq{"topics": "null"}, builder.Neq{"topics": "[]"}))
|
||||
}
|
||||
|
||||
// Description checking. Description not empty.
|
||||
// Description checking. Description not empty
|
||||
subQueryCond = subQueryCond.Or(builder.Neq{"description": ""})
|
||||
|
||||
// Repo has a avatar.
|
||||
// Repo has a avatar
|
||||
subQueryCond = subQueryCond.Or(builder.Neq{"avatar": ""})
|
||||
|
||||
// Always hide repo's that are empty.
|
||||
// Always hide repo's that are empty
|
||||
subQueryCond = subQueryCond.And(builder.Eq{"is_empty": false})
|
||||
|
||||
cond = cond.And(subQueryCond)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue