File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -329,16 +329,24 @@ private function addRecommendedFilter()
329329
330330 private function addRankedFilter (): void
331331 {
332+ static $ approvedStates = [
333+ Beatmapset::STATES ['ranked ' ],
334+ Beatmapset::STATES ['approved ' ],
335+ Beatmapset::STATES ['loved ' ],
336+ ];
337+
332338 if ($ this ->includes ->ranked !== null ) {
333339 $ this ->query
334- ->filter (['terms ' => ['approved ' => [
335- Beatmapset::STATES ['ranked ' ],
336- Beatmapset::STATES ['approved ' ],
337- Beatmapset::STATES ['loved ' ],
338- ]]])->filter (['range ' => ['approved_date ' => $ this ->includes ->ranked ]]);
340+ ->filter (['terms ' => ['approved ' => $ approvedStates ]])
341+ ->filter (['range ' => ['approved_date ' => $ this ->includes ->ranked ]]);
339342 }
340343
341- // TODO: add ranked exclusion
344+ // ranked date exclusion assumes we're still looking for ranked maps.
345+ if ($ this ->excludes ->ranked !== null ) {
346+ $ this ->query
347+ ->filter (['terms ' => ['approved ' => $ approvedStates ]])
348+ ->mustNot (['range ' => ['approved_date ' => $ this ->excludes ->ranked ]]);
349+ }
342350 }
343351
344352 private function addSimpleFilters (): void
You can’t perform that action at this time.
0 commit comments