Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
th0mk committed Apr 9, 2024
1 parent e2fd6b3 commit e2a5ab6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/FMBot.Bot/Services/PlayService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ public async Task<IList<UserPlay>> GetGuildUsersPlays(int guildId, int amountOfD
"FROM user_plays AS up " +
"INNER JOIN users AS u ON up.user_id = u.user_id " +
"INNER JOIN guild_users AS gu ON gu.user_id = u.user_id " +
$"WHERE gu.guild_id = @guildId AND gu.bot != true AND time_played > current_date - interval '{amountOfDays}' day " +
$"WHERE gu.guild_id = @guildId AND gu.bot != true AND time_played > current_date - interval '{amountOfDays}' day AND artist_name IS NOT NULL " +
"AND NOT up.user_id = ANY(SELECT user_id FROM guild_blocked_users WHERE blocked_from_who_knows = true AND guild_id = @guildId) " +
"AND (gu.who_knows_whitelisted OR gu.who_knows_whitelisted IS NULL) ";

Expand All @@ -811,7 +811,7 @@ public async Task<List<UserPlay>> GetGuildUsersPlaysForTimeLeaderBoard(int guild
"INNER JOIN users AS u ON up.user_id = u.user_id " +
"INNER JOIN guild_users AS gu ON gu.user_id = u.user_id " +
"WHERE gu.guild_id = @guildId " +
"AND time_played > current_date - interval '9' day AND time_played < current_date - interval '2' day " +
"AND time_played > current_date - interval '9' day AND time_played < current_date - interval '2' day AND artist_name IS NOT NULL " +
"AND NOT up.user_id = ANY(SELECT user_id FROM guild_blocked_users WHERE blocked_from_who_knows = true AND guild_id = @guildId) " +
"AND (gu.who_knows_whitelisted OR gu.who_knows_whitelisted IS NULL) ";

Expand Down
2 changes: 1 addition & 1 deletion src/FMBot.Bot/Services/WhoKnows/WhoKnowsArtistService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public async Task<ICollection<AffinityItemDto>> GetQuarterlyTopArtistForGuild(in
" ROW_NUMBER() OVER (PARTITION BY up.user_id ORDER BY COUNT(*) DESC) as pos " +
"FROM user_plays AS up " +
"INNER JOIN guild_users AS gu ON gu.user_id = up.user_id " +
$"WHERE gu.guild_id = @guildId AND time_played > current_date - interval '{amountOfDays}' day " +
$"WHERE gu.guild_id = @guildId AND time_played > current_date - interval '{amountOfDays}' day AND artist_name IS NOT NULL " +
"GROUP BY up.user_id, artist_name " +
") as subquery " +
$"WHERE pos <= {amount}; ";
Expand Down

0 comments on commit e2a5ab6

Please sign in to comment.