Misc UI Tweaks (#1692)

* Added a timeAgo pipe which shows live updates for a few areas.

* Fixed some wording on stats page. Changed Total People count to just work on distinct names and not count multiple for different roles.

* Tweaked the compact number so it only shows one decimal

* Fixed a bug
This commit is contained in:
Joe Milazzo 2022-12-11 16:29:46 -06:00 committed by GitHub
parent 20441f5ec3
commit 4548dcb1eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 155 additions and 7 deletions

View file

@ -240,13 +240,21 @@ public class StatisticService : IStatisticService
.ProjectTo<SeriesDto>(_mapper.ConfigurationProvider)
.AsEnumerable();
var distinctPeople = _context.Person
.AsSplitQuery()
.AsEnumerable()
.GroupBy(sm => sm.NormalizedName)
.Select(sm => sm.Key)
.Distinct()
.Count();
return new ServerStatistics()
{
ChapterCount = await _context.Chapter.CountAsync(),
SeriesCount = await _context.Series.CountAsync(),
TotalFiles = await _context.MangaFile.CountAsync(),
TotalGenres = await _context.Genre.CountAsync(),
TotalPeople = await _context.Person.CountAsync(),
TotalPeople = distinctPeople,
TotalSize = await _context.MangaFile.SumAsync(m => m.Bytes),
TotalTags = await _context.Tag.CountAsync(),
VolumeCount = await _context.Volume.Where(v => v.Number != 0).CountAsync(),