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

fix(GameSuggestionEngine): exclude non-game systems from mastered/beaten initial query #3189

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private function initializeStrategies(User $user): void
];
} else {
$masteredGames = Game::query()
->whereNotIn('ConsoleID', System::getNonGameSystems())
->whereHas('playerGames', function ($query) {
$query->whereUserId($this->user->id)
->whereColumn('achievements_unlocked', 'achievements_total')
Expand All @@ -58,6 +59,7 @@ private function initializeStrategies(User $user): void
->get();

$beatenGames = Game::query()
->whereNotIn('ConsoleID', System::getNonGameSystems())
->whereHas('playerGames', function ($query) {
$query->whereUserId($this->user->id)
->whereNotNull('beaten_at');
Expand Down Expand Up @@ -121,6 +123,7 @@ private function initializeStrategies(User $user): void
new Strategies\SharedAuthorStrategy($beatenGame, SourceGameKind::Beaten),
$weight * 0.2,
];

$this->strategies[] = [new Strategies\CommonPlayersStrategy($this->user, $beatenGame), $weight * 0.4];
}

Expand Down