mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-06 06:45:18 -04:00
Progress Overhaul + Profile Page and a LOT more! (#4262)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com> Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using API.DTOs;
|
||||
@@ -8,10 +7,8 @@ using API.Entities;
|
||||
using API.Entities.Enums;
|
||||
using API.Extensions;
|
||||
using API.Extensions.QueryExtensions;
|
||||
using API.Services;
|
||||
using AutoMapper;
|
||||
using AutoMapper.QueryableExtensions;
|
||||
using Kavita.Common;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace API.Data.Repositories;
|
||||
@@ -262,6 +259,7 @@ public class VolumeRepository : IVolumeRepository
|
||||
var progresses = userProgress.Where(p => p.ChapterId == c.Id).ToList();
|
||||
if (progresses.Count == 0) continue;
|
||||
c.PagesRead = progresses.Sum(p => p.PagesRead);
|
||||
c.TotalReads = progresses.Min(p => p.TotalReads);
|
||||
c.LastReadingProgressUtc = progresses.Max(p => p.LastModifiedUtc);
|
||||
c.LastReadingProgress = progresses.Max(p => p.LastModified);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user