Skip to content

Commit

Permalink
fix(GameSuggestionEngine): exclude event games from mastered/beaten i…
Browse files Browse the repository at this point in the history
…nitial query (#3189)
  • Loading branch information
wescopeland authored Feb 6, 2025
1 parent e3a6542 commit c596ee0
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit c596ee0

Please sign in to comment.