Misc Bugfixes (#1378)

* Fixed an issue where sometimes when loading the next page, the pagination area wouldn't be properly setup due to a missed rendering cycle

* Refactored BookController to thin it out and refactor some of the functions to apply IOC. Added some split query statements on a few queries.

* Added Split Query to many queries

* Added a visual indicator for loading state of PDF. Will spruce up css later.

* Added back in logic

* Fixed flash of white when refreshing browser

* Hooked in a loading progress bar for the pdf reader

* Close the pdf reader when pressing ESC
This commit is contained in:
Joseph Milazzo 2022-07-17 10:19:36 -04:00 committed by GitHub
parent 3a10b54422
commit c650436f57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 315 additions and 389 deletions

View file

@ -62,6 +62,7 @@ public class VolumeRepository : IVolumeRepository
.Where(c => volumeId == c.VolumeId)
.Include(c => c.Files)
.SelectMany(c => c.Files)
.AsSplitQuery()
.AsNoTracking()
.ToListAsync();
}
@ -106,7 +107,7 @@ public class VolumeRepository : IVolumeRepository
if (includeChapters)
{
query = query.Include(v => v.Chapters);
query = query.Include(v => v.Chapters).AsSplitQuery();
}
return await query.ToListAsync();
}
@ -123,6 +124,7 @@ public class VolumeRepository : IVolumeRepository
.Where(vol => vol.Id == volumeId)
.Include(vol => vol.Chapters)
.ThenInclude(c => c.Files)
.AsSplitQuery()
.ProjectTo<VolumeDto>(_mapper.ConfigurationProvider)
.SingleAsync(vol => vol.Id == volumeId);
@ -143,6 +145,7 @@ public class VolumeRepository : IVolumeRepository
.Where(vol => vol.SeriesId == seriesId)
.Include(vol => vol.Chapters)
.ThenInclude(c => c.Files)
.AsSplitQuery()
.OrderBy(vol => vol.Number)
.ToListAsync();
}
@ -157,6 +160,7 @@ public class VolumeRepository : IVolumeRepository
return await _context.Volume
.Include(vol => vol.Chapters)
.ThenInclude(c => c.Files)
.AsSplitQuery()
.SingleOrDefaultAsync(vol => vol.Id == volumeId);
}
@ -220,6 +224,4 @@ public class VolumeRepository : IVolumeRepository
v.PagesRead = userProgress.Where(p => p.VolumeId == v.Id).Sum(p => p.PagesRead);
}
}
}