Skip to content

Commit 26f9bc9

Browse files
committed
WIP: hide images with usages@status:replaced from search by default (like we do with is:deleted for soft-deletion) unless explicitly searched for
1 parent 6477935 commit 26f9bc9

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

media-api/app/lib/querysyntax/Parser.scala

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ package lib.querysyntax
22

33
object Parser {
44

5+
private val thingsToHideByDefault = List(
6+
"is:deleted",
7+
"usages@status:replaced"
8+
)
9+
510
def run(input: String): List[Condition] = {
611
normalise(
712
parse(
8-
if(input.contains("is:deleted")) input
9-
else input.concat(" -is:deleted").trim
10-
)
13+
thingsToHideByDefault.fold(input)((input, thingToHide) =>
14+
if(input.contains(thingToHide)) input
15+
else input.concat(s" -$thingToHide").trim
16+
))
1117
)
1218
}
1319

0 commit comments

Comments
 (0)