Feature/stats finishoff (#1720)
* Added ability to click on genres, tags, and people to view all items in a modal. * Made it so we can click and open a filtered search from generic list * Fixed broken epub pagination area due to a typo in a query selector * Added day breakdown, wrapping up stats
This commit is contained in:
parent
dfbc8da427
commit
02daa5ed56
20 changed files with 378 additions and 66 deletions
|
@ -27,6 +27,7 @@ public interface IStatisticService
|
|||
Task<IEnumerable<TopReadDto>> GetTopUsers(int days);
|
||||
Task<IEnumerable<ReadHistoryEvent>> GetReadingHistory(int userId);
|
||||
Task<IEnumerable<PagesReadOnADayCount<DateTime>>> ReadCountByDay(int userId = 0, int days = 0);
|
||||
IEnumerable<StatCount<DayOfWeek>> GetDayBreakdown();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -385,6 +386,17 @@ public class StatisticService : IStatisticService
|
|||
return results;
|
||||
}
|
||||
|
||||
public IEnumerable<StatCount<DayOfWeek>> GetDayBreakdown()
|
||||
{
|
||||
return _context.AppUserProgresses
|
||||
.AsSplitQuery()
|
||||
.AsNoTracking()
|
||||
.GroupBy(p => p.LastModified.DayOfWeek)
|
||||
.OrderBy(g => g.Key)
|
||||
.Select(g => new StatCount<DayOfWeek>{ Value = g.Key, Count = g.Count() })
|
||||
.AsEnumerable();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<TopReadDto>> GetTopUsers(int days)
|
||||
{
|
||||
var libraries = (await _unitOfWork.LibraryRepository.GetLibrariesAsync()).ToList();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue