Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add played filter to beatmap listing #3051

Merged

Conversation

notbakaneko
Copy link
Collaborator

fixes #2846

@@ -111,6 +112,19 @@ private function addModeFilter($query)
}
}

private function addPlayedFilter($query)
{
if ($this->params->user === null || !$this->params->user->isSupporter()) {

This comment was marked as off-topic.

private function getPlayedBeatmapIds()
{
$unionQuery = null;
foreach ($this->getSelectedModes() as $mode) {

This comment was marked as off-topic.


namespace App\Libraries\Search;

abstract class PlayedState

This comment was marked as off-topic.

@@ -59,6 +59,8 @@ public function __construct(Request $request, ?User $user = null)
explode('.', $request['r'] ?? null),
$validRanks
);

$this->playedState = get_int($request['p']) ?? PlayedState::ALL;

This comment was marked as off-topic.

}

if ($this->params->playedState === PlayedState::PLAYED) {
$query->filter(['terms' => ['difficulties.beatmap_id' => $this->getPlayedBeatmapIds()]]);

This comment was marked as off-topic.

This comment was marked as off-topic.

@nanaya nanaya merged commit 9e0aae5 into ppy:master Apr 23, 2018
@notbakaneko notbakaneko deleted the feature/beatmap-listing-unplayed-filter-rebase branch April 23, 2018 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to view unplayed ranked maps
2 participants