mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Fixed a math issue with read progress where fully read series would calculate progress as 99.9999 and get included in on deck.
This commit is contained in:
parent
9832863040
commit
e1c9db05a8
@ -14,7 +14,7 @@ namespace API.Extensions.QueryExtensions.Filtering;
|
||||
|
||||
public static class SeriesFilter
|
||||
{
|
||||
private const float FloatingPointTolerance = 0.01f;
|
||||
private const float FloatingPointTolerance = 0.001f;
|
||||
public static IQueryable<Series> HasLanguage(this IQueryable<Series> queryable, bool condition,
|
||||
FilterComparison comparison, IList<string> languages)
|
||||
{
|
||||
@ -243,9 +243,9 @@ public static class SeriesFilter
|
||||
.Select(s => new
|
||||
{
|
||||
Series = s,
|
||||
Percentage = Math.Truncate(((double) s.Progress
|
||||
Percentage = ((float) s.Progress
|
||||
.Where(p => p != null && p.AppUserId == userId)
|
||||
.Sum(p => p != null ? (p.PagesRead * 1.0f / s.Pages) : 0) * 100))
|
||||
.Sum(p => p != null ? (p.PagesRead * 1.0f / s.Pages) : 0) * 100)
|
||||
})
|
||||
.AsEnumerable();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user