Skip to content

Commit

Permalink
Fix bug where reviews would always contain your own level rating inst…
Browse files Browse the repository at this point in the history
…ead of that of the reviewer's (#688)

Fixes issue #656 and additionally also corrects a method's name (see the
changes below)
  • Loading branch information
jvyden authored Nov 16, 2024
2 parents 0d8dda6 + 2699259 commit 7175864
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Refresh.GameServer/Endpoints/Game/ReviewEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public Response GetReviewsForLevel(RequestContext context, GameDatabaseContext d

[GameEndpoint("reviewsBy/{username}", ContentType.Xml)]
[AllowEmptyBody]
public Response GetReviewsForLevel(RequestContext context, GameDatabaseContext database, string username,
public Response GetReviewsByUser(RequestContext context, GameDatabaseContext database, string username,
DataContext dataContext)
{
GameUser? user = database.GetUserByUsername(username);
Expand Down
2 changes: 1 addition & 1 deletion Refresh.GameServer/Types/Reviews/SerializedGameReview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class SerializedGameReview : IDataConvertableFrom<SerializedGameReview, G
Deleted = false,
DeletedBy = ReviewDeletedBy.None,
Text = review.Content,
Thumb = dataContext.Database.GetRatingByUser(review.Level, dataContext.User!)?.ToDPad() ?? 0,
Thumb = dataContext.Database.GetRatingByUser(review.Level, review.Publisher)?.ToDPad() ?? 0,
ThumbsUp = reviewRatings.PositiveRating,
ThumbsDown = reviewRatings.NegativeRating,
YourThumb = (int) userRatingType,
Expand Down

0 comments on commit 7175864

Please sign in to comment.