Skip to content

Commit

Permalink
User Rating Fix (#3340)
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 authored Nov 4, 2024
1 parent a977594 commit c00e18d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions API/Extensions/QueryExtensions/Filtering/SeriesFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,9 @@ public static IQueryable<Series> HasRating(this IQueryable<Series> queryable, bo
{
if (rating < 0 || !condition || userId <= 0) return queryable;

// Users see rating as %, so they are likely to pass 10%. We need to turn that into the underlying float encoding
if (rating.IsNot(0f))
{
rating /= 100f;
}
// AppUserRating stores a 5-digit number.
rating = Math.Clamp(rating, 0f, 5f);


switch (comparison)
{
Expand Down
2 changes: 1 addition & 1 deletion UI/Web/src/assets/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,7 @@
"unit-reading-date": "Date",
"unit-average-rating": "Kavita+ external rating, percent",
"unit-reading-progress": "Percent",
"unit-user-rating": "{{metadata-filter-row.unit-reading-progress}}",
"unit-user-rating": "0.0 - 5.0 Stars",
"unit-read-last": "Days from TODAY"
},

Expand Down

0 comments on commit c00e18d

Please sign in to comment.